Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
1ccd1daa
Commit
1ccd1daa
authored
Nov 26, 2020
by
Anel Husakovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-24289: show grants missing with grant option
Reviewed by:serg@mariadb.com
parent
5991bd62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
mysql-test/suite/roles/show_grants.result
mysql-test/suite/roles/show_grants.result
+15
-0
mysql-test/suite/roles/show_grants.test
mysql-test/suite/roles/show_grants.test
+13
-0
sql/sql_acl.cc
sql/sql_acl.cc
+2
-1
No files found.
mysql-test/suite/roles/show_grants.result
View file @
1ccd1daa
...
...
@@ -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;
mysql-test/suite/roles/show_grants.test
View file @
1ccd1daa
...
...
@@ -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
;
sql/sql_acl.cc
View file @
1ccd1daa
...
...
@@ -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
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment