2013-11-02 16:26:35 +01:00
|
|
|
--source include/not_embedded.inc
|
2018-11-24 14:13:41 +01:00
|
|
|
select priv into @root_priv from mysql.global_priv where user='root' and host='localhost';
|
2013-11-02 16:26:35 +01:00
|
|
|
|
|
|
|
--error ER_MALFORMED_DEFINER
|
|
|
|
grant select on *.* to current_role;
|
|
|
|
--error ER_MALFORMED_DEFINER
|
|
|
|
revoke select on *.* from current_role;
|
|
|
|
--error ER_MALFORMED_DEFINER
|
|
|
|
revoke all, grant option from current_role;
|
|
|
|
|
|
|
|
create role r1;
|
|
|
|
grant insert on test.* to r1;
|
|
|
|
grant r1 to current_user;
|
|
|
|
set role r1;
|
|
|
|
select current_role();
|
|
|
|
|
|
|
|
grant select on *.* to current_role;
|
|
|
|
show grants for current_role;
|
|
|
|
revoke insert on test.* from current_role;
|
|
|
|
show grants for current_role;
|
|
|
|
revoke all, grant option from current_role;
|
|
|
|
show grants for current_role;
|
|
|
|
|
2014-11-24 15:10:51 +01:00
|
|
|
set password=password('foobar');
|
|
|
|
show grants;
|
|
|
|
grant r1 to current_user() identified by 'barfoo';
|
|
|
|
show grants;
|
|
|
|
set password='';
|
2013-11-02 16:26:35 +01:00
|
|
|
|
2018-11-24 14:13:41 +01:00
|
|
|
#cleanup
|
2014-11-24 15:10:51 +01:00
|
|
|
drop role r1;
|
2020-02-19 17:50:30 +01:00
|
|
|
update mysql.global_priv set priv=@root_priv where user='root' and host='localhost';
|