mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-24289: show grants missing with grant option
Reviewed by:serg@mariadb.com
This commit is contained in:
@ -146,3 +146,18 @@ drop role test_role2;
|
|||||||
delete from mysql.roles_mapping where Role='test_role1';
|
delete from mysql.roles_mapping where Role='test_role1';
|
||||||
delete from mysql.roles_mapping where Role='test_role2';
|
delete from mysql.roles_mapping where Role='test_role2';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
#
|
||||||
|
# MDEV-24289: show grants missing with grant option
|
||||||
|
#
|
||||||
|
create role anel;
|
||||||
|
GRANT SELECT, UPDATE, DELETE, ALTER ON *.* TO 'anel';
|
||||||
|
SHOW GRANTS for 'anel';
|
||||||
|
Grants for anel
|
||||||
|
GRANT SELECT, UPDATE, DELETE, ALTER ON *.* TO 'anel'
|
||||||
|
create role MariaDB_admin;
|
||||||
|
GRANT SELECT, UPDATE, DELETE, ALTER ON *.* TO 'MariaDB_admin' WITH GRANT OPTION;
|
||||||
|
SHOW GRANTS for 'MariaDB_admin';
|
||||||
|
Grants for MariaDB_admin
|
||||||
|
GRANT SELECT, UPDATE, DELETE, ALTER ON *.* TO 'MariaDB_admin' WITH GRANT OPTION
|
||||||
|
drop role MariaDB_admin;
|
||||||
|
drop role anel;
|
||||||
|
@ -88,3 +88,16 @@ drop role test_role2;
|
|||||||
delete from mysql.roles_mapping where Role='test_role1';
|
delete from mysql.roles_mapping where Role='test_role1';
|
||||||
delete from mysql.roles_mapping where Role='test_role2';
|
delete from mysql.roles_mapping where Role='test_role2';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-24289: show grants missing with grant option
|
||||||
|
--echo #
|
||||||
|
create role anel;
|
||||||
|
GRANT SELECT, UPDATE, DELETE, ALTER ON *.* TO 'anel';
|
||||||
|
SHOW GRANTS for 'anel';
|
||||||
|
|
||||||
|
create role MariaDB_admin;
|
||||||
|
GRANT SELECT, UPDATE, DELETE, ALTER ON *.* TO 'MariaDB_admin' WITH GRANT OPTION;
|
||||||
|
SHOW GRANTS for 'MariaDB_admin';
|
||||||
|
drop role MariaDB_admin;
|
||||||
|
drop role anel;
|
||||||
|
@ -8945,7 +8945,8 @@ static bool show_global_privileges(THD *thd, ACL_USER_BASE *acl_entry,
|
|||||||
|
|
||||||
if (!handle_as_role)
|
if (!handle_as_role)
|
||||||
add_user_parameters(&global, (ACL_USER *)acl_entry, (want_access & GRANT_ACL));
|
add_user_parameters(&global, (ACL_USER *)acl_entry, (want_access & GRANT_ACL));
|
||||||
|
else if (want_access & GRANT_ACL)
|
||||||
|
global.append(STRING_WITH_LEN(" WITH GRANT OPTION"));
|
||||||
protocol->prepare_for_resend();
|
protocol->prepare_for_resend();
|
||||||
protocol->store(global.ptr(),global.length(),global.charset());
|
protocol->store(global.ptr(),global.length(),global.charset());
|
||||||
if (protocol->write())
|
if (protocol->write())
|
||||||
|
Reference in New Issue
Block a user