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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
287f2d29
Commit
287f2d29
authored
8 years ago
by
Vicențiu Ciorbaru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-9443: Add REVOKE <role> as a command to PREPARE
parent
c4bef7ad
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
mysql-test/suite/roles/prepare_stmt_with_role.result
mysql-test/suite/roles/prepare_stmt_with_role.result
+9
-0
mysql-test/suite/roles/prepare_stmt_with_role.test
mysql-test/suite/roles/prepare_stmt_with_role.test
+9
-0
sql/sql_prepare.cc
sql/sql_prepare.cc
+1
-0
No files found.
mysql-test/suite/roles/prepare_stmt_with_role.result
View file @
287f2d29
...
...
@@ -38,6 +38,15 @@ Grants for test_user@%
GRANT developers TO 'test_user'@'%'
GRANT USAGE ON *.* TO 'test_user'@'%'
#
# Test revoking a role.
#
SET @revokeRole = 'REVOKE developers FROM test_user';
PREPARE stmtRevokeRole FROM @revokeRole;
EXECUTE stmtRevokeRole;
SHOW GRANTS FOR test_user;
Grants for test_user@%
GRANT USAGE ON *.* TO 'test_user'@'%'
#
# Now drop the role.
#
SET @dropRole = 'DROP ROLE developers';
...
...
This diff is collapsed.
Click to expand it.
mysql-test/suite/roles/prepare_stmt_with_role.test
View file @
287f2d29
...
...
@@ -32,6 +32,15 @@ EXECUTE stmtGrantRole;
SELECT
*
FROM
mysql
.
roles_mapping
;
SHOW
GRANTS
FOR
test_user
;
--
echo
#
--
echo
# Test revoking a role.
--
echo
#
SET
@
revokeRole
=
'REVOKE developers FROM test_user'
;
PREPARE
stmtRevokeRole
FROM
@
revokeRole
;
EXECUTE
stmtRevokeRole
;
SHOW
GRANTS
FOR
test_user
;
--
echo
#
--
echo
# Now drop the role.
--
echo
#
...
...
This diff is collapsed.
Click to expand it.
sql/sql_prepare.cc
View file @
287f2d29
...
...
@@ -2465,6 +2465,7 @@ static bool check_prepared_statement(Prepared_statement *stmt)
case
SQLCOM_GRANT
:
case
SQLCOM_GRANT_ROLE
:
case
SQLCOM_REVOKE
:
case
SQLCOM_REVOKE_ROLE
:
case
SQLCOM_KILL
:
case
SQLCOM_COMPOUND
:
case
SQLCOM_SHUTDOWN
:
...
...
This diff is collapsed.
Click to expand it.
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