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
320b8528
Commit
320b8528
authored
Nov 02, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grant/revoke ... to/from current_role
parent
1f036865
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
1 deletion
+54
-1
mysql-test/suite/roles/grant_revoke_current.result
mysql-test/suite/roles/grant_revoke_current.result
+27
-0
mysql-test/suite/roles/grant_revoke_current.test
mysql-test/suite/roles/grant_revoke_current.test
+24
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+3
-1
No files found.
mysql-test/suite/roles/grant_revoke_current.result
0 → 100644
View file @
320b8528
grant select on *.* to current_role;
ERROR 0L000: Invalid definer
revoke select on *.* from current_role;
ERROR 0L000: Invalid definer
revoke all, grant option from current_role;
ERROR 0L000: Invalid definer
create role r1;
grant insert on test.* to r1;
grant r1 to current_user;
set role r1;
select current_role();
current_role()
r1
grant select on *.* to current_role;
show grants for current_role;
Grants for r1
GRANT SELECT ON *.* TO 'r1'
GRANT INSERT ON `test`.* TO 'r1'
revoke insert on test.* from current_role;
show grants for current_role;
Grants for r1
GRANT SELECT ON *.* TO 'r1'
revoke all, grant option from current_role;
show grants for current_role;
Grants for r1
GRANT USAGE ON *.* TO 'r1'
drop role r1;
mysql-test/suite/roles/grant_revoke_current.test
0 → 100644
View file @
320b8528
--
source
include
/
not_embedded
.
inc
--
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
;
drop
role
r1
;
sql/sql_yacc.yy
View file @
320b8528
...
@@ -14356,9 +14356,11 @@ role_list:
...
@@ -14356,9 +14356,11 @@ role_list:
current_role:
current_role:
CURRENT_ROLE optional_braces
CURRENT_ROLE optional_braces
{
{
if (!($$=(LEX_USER*) thd->alloc(sizeof(LEX_USER))))
if (!($$=(LEX_USER*) thd->
c
alloc(sizeof(LEX_USER))))
MYSQL_YYABORT;
MYSQL_YYABORT;
$$->user= current_role;
$$->user= current_role;
$$->plugin= empty_lex_str;
$$->auth= empty_lex_str;
}
}
;
;
...
...
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