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
89939843
Commit
89939843
authored
Oct 18, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CURRENT_ROLE() should return NULL, not "NONE"
parent
97c39894
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
27 additions
and
30 deletions
+27
-30
mysql-test/r/acl_roles_set_role-database-recursive.result
mysql-test/r/acl_roles_set_role-database-recursive.result
+2
-2
mysql-test/r/acl_roles_set_role-database-simple.result
mysql-test/r/acl_roles_set_role-database-simple.result
+2
-2
mysql-test/r/acl_roles_set_role-multiple-role.result
mysql-test/r/acl_roles_set_role-multiple-role.result
+2
-2
mysql-test/r/acl_roles_set_role-recursive.result
mysql-test/r/acl_roles_set_role-recursive.result
+4
-4
mysql-test/r/acl_roles_set_role-routine-simple.result
mysql-test/r/acl_roles_set_role-routine-simple.result
+2
-2
mysql-test/r/acl_roles_set_role-simple.result
mysql-test/r/acl_roles_set_role-simple.result
+2
-2
mysql-test/r/acl_roles_set_role-table-column-priv.result
mysql-test/r/acl_roles_set_role-table-column-priv.result
+2
-2
mysql-test/r/acl_roles_set_role-table-simple.result
mysql-test/r/acl_roles_set_role-table-simple.result
+2
-2
mysql-test/r/acl_roles_show_grants.result
mysql-test/r/acl_roles_show_grants.result
+2
-2
sql/item_strfunc.cc
sql/item_strfunc.cc
+7
-10
No files found.
mysql-test/r/acl_roles_set_role-database-recursive.result
View file @
89939843
...
...
@@ -31,7 +31,7 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
set role test_role1;
select current_user(), current_role();
current_user() current_role()
...
...
@@ -44,7 +44,7 @@ localhost test_user test_role2
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
set role test_role2;
...
...
mysql-test/r/acl_roles_set_role-database-simple.result
View file @
89939843
...
...
@@ -18,7 +18,7 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
set role test_role1;
select current_user(), current_role();
current_user() current_role()
...
...
@@ -36,7 +36,7 @@ use mysql;
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
use mysql;
ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'mysql'
select * from mysql.roles_mapping;
...
...
mysql-test/r/acl_roles_set_role-multiple-role.result
View file @
89939843
...
...
@@ -71,7 +71,7 @@ GRANT r_sel TO 'test_user'@'localhost'
GRANT r_upd TO 'test_user'@'localhost'
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
set role r_sel;
select current_user(), current_role();
current_user() current_role()
...
...
@@ -131,7 +131,7 @@ flush privileges;
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
flush privileges;
ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
set role r_ins;
...
...
mysql-test/r/acl_roles_set_role-recursive.result
View file @
89939843
...
...
@@ -37,7 +37,7 @@ GRANT USAGE ON *.* TO 'test_user'@'localhost'
GRANT test_role1 TO 'test_user'@'localhost'
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
set role test_role1;
select current_user(), current_role();
current_user() current_role()
...
...
@@ -62,7 +62,7 @@ GRANT test_role2 TO 'test_role1'
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
show grants;
Grants for test_user@localhost
GRANT USAGE ON *.* TO 'test_user'@'localhost'
...
...
@@ -77,7 +77,7 @@ set role test_role2;
ERROR HY000: The role 'test_role2' has not been granted or is invalid.
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
show grants;
Grants for test_user@localhost
GRANT USAGE ON *.* TO 'test_user'@'localhost'
...
...
@@ -112,7 +112,7 @@ GRANT test_role2 TO 'test_role1'
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
show grants;
Grants for test_user@localhost
GRANT USAGE ON *.* TO 'test_user'@'localhost'
...
...
mysql-test/r/acl_roles_set_role-routine-simple.result
View file @
89939843
...
...
@@ -42,7 +42,7 @@ use mysql;
ERROR 42000: Access denied for user 'test_user'@'localhost' to database 'mysql'
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
set role test_role1;
select current_user(), current_role();
current_user() current_role()
...
...
@@ -68,7 +68,7 @@ GRANT test_role3 TO 'test_user'@'localhost'
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
show grants;
Grants for test_user@localhost
GRANT USAGE ON *.* TO 'test_user'@'localhost'
...
...
mysql-test/r/acl_roles_set_role-simple.result
View file @
89939843
...
...
@@ -24,7 +24,7 @@ GRANT USAGE ON *.* TO 'test_user'@'localhost'
GRANT test_role1 TO 'test_user'@'localhost'
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
set role test_role1;
select current_user(), current_role();
current_user() current_role()
...
...
@@ -40,7 +40,7 @@ localhost test_user test_role1
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
delete from mysql.user where user='test_role1';
...
...
mysql-test/r/acl_roles_set_role-table-column-priv.result
View file @
89939843
...
...
@@ -26,7 +26,7 @@ GRANT USAGE ON *.* TO 'test_user'@'localhost'
GRANT test_role1 TO 'test_user'@'localhost'
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
set role test_role1;
select current_user(), current_role();
current_user() current_role()
...
...
@@ -57,7 +57,7 @@ use mysql;
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
select RoleFk from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
drop user 'test_user'@'localhost';
...
...
mysql-test/r/acl_roles_set_role-table-simple.result
View file @
89939843
...
...
@@ -26,7 +26,7 @@ GRANT USAGE ON *.* TO 'test_user'@'localhost'
GRANT test_role1 TO 'test_user'@'localhost'
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
set role test_role1;
select current_user(), current_role();
current_user() current_role()
...
...
@@ -55,7 +55,7 @@ use mysql;
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
drop user 'test_user'@'localhost';
...
...
mysql-test/r/acl_roles_show_grants.result
View file @
89939843
...
...
@@ -34,7 +34,7 @@ GRANT test_role1 TO 'test_user'@'localhost'
GRANT test_role2 TO 'test_user'@'localhost'
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
set role test_role1;
select current_user(), current_role();
current_user() current_role()
...
...
@@ -51,7 +51,7 @@ GRANT test_role2 TO 'test_user'@'localhost'
set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost N
ONE
test_user@localhost N
ULL
show grants;
Grants for test_user@localhost
GRANT USAGE ON *.* TO 'test_user'@'localhost'
...
...
sql/item_strfunc.cc
View file @
89939843
...
...
@@ -2345,20 +2345,17 @@ bool Item_func_current_role::fix_fields(THD *thd, Item **ref)
Security_context
*
ctx
=
context
->
security_ctx
?
context
->
security_ctx
:
thd
->
security_ctx
;
LEX_STRING
role
;
if
(
ctx
->
priv_role
[
0
])
{
role
.
str
=
ctx
->
priv_role
;
role
.
length
=
strlen
(
role
.
str
);
}
else
role
=
none_role
;
if
(
str_value
.
copy
(
role
.
str
,
role
.
length
,
system_charset_info
))
if
(
str_value
.
copy
(
ctx
->
priv_role
,
strlen
(
ctx
->
priv_role
),
system_charset_info
))
return
1
;
str_value
.
mark_as_const
();
return
0
;
}
null_value
=
maybe_null
=
1
;
return
0
;
}
...
...
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