mirror of
https://github.com/MariaDB/server.git
synced 2025-04-20 22:25:30 +02:00
MDEV-24289: show grants missing with grant option
Reviewed by:serg@mariadb.com
This commit is contained in:
parent
5991bd6215
commit
1ccd1daaff
3 changed files with 30 additions and 1 deletions
|
@ -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_role2';
|
||||
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_role2';
|
||||
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)
|
||||
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->store(global.ptr(),global.length(),global.charset());
|
||||
if (protocol->write())
|
||||
|
|
Loading…
Add table
Reference in a new issue