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
92eafe1a
Commit
92eafe1a
authored
Jan 28, 2014
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-5521 SET ROLE as prepared statement crashes the server
set_role::light_check() was incorrect
parent
03b428d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
mysql-test/suite/roles/ps.result
mysql-test/suite/roles/ps.result
+1
-0
mysql-test/suite/roles/ps.test
mysql-test/suite/roles/ps.test
+4
-0
sql/set_var.cc
sql/set_var.cc
+2
-4
sql/set_var.h
sql/set_var.h
+4
-3
No files found.
mysql-test/suite/roles/ps.result
0 → 100644
View file @
92eafe1a
PREPARE stmt FROM 'SET ROLE NONE';
mysql-test/suite/roles/ps.test
0 → 100644
View file @
92eafe1a
#
# MDEV-5521 SET ROLE as prepared statement crashes the server
#
PREPARE
stmt
FROM
'SET ROLE NONE'
;
sql/set_var.cc
View file @
92eafe1a
...
...
@@ -855,9 +855,7 @@ int set_var_password::update(THD *thd)
int
set_var_role
::
check
(
THD
*
thd
)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
ulonglong
access
;
int
status
=
acl_check_setrole
(
thd
,
base
.
str
,
&
access
);
save_result
.
ulonglong_value
=
access
;
int
status
=
acl_check_setrole
(
thd
,
role
.
str
,
&
access
);
return
status
;
#else
return
0
;
...
...
@@ -867,7 +865,7 @@ int set_var_role::check(THD *thd)
int
set_var_role
::
update
(
THD
*
thd
)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
return
acl_setrole
(
thd
,
base
.
str
,
save_result
.
ulonglong_value
);
return
acl_setrole
(
thd
,
role
.
str
,
access
);
#else
return
0
;
#endif
...
...
sql/set_var.h
View file @
92eafe1a
...
...
@@ -278,11 +278,12 @@ public:
/* For SET ROLE */
class
set_var_role
:
public
set_var
class
set_var_role
:
public
set_var
_base
{
LEX_STRING
role
;
ulonglong
access
;
public:
set_var_role
(
LEX_STRING
role_arg
)
:
set_var
(
OPT_SESSION
,
NULL
,
&
role_arg
,
NULL
){};
set_var_role
(
LEX_STRING
role_arg
)
:
role
(
role_arg
)
{}
int
check
(
THD
*
thd
);
int
update
(
THD
*
thd
);
};
...
...
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