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
03b428d2
Commit
03b428d2
authored
Jan 28, 2014
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-5520 Connection lost on wrong CREATE ROLE
parent
74d29b0e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
mysql-test/suite/roles/create_and_drop_role.result
mysql-test/suite/roles/create_and_drop_role.result
+2
-0
mysql-test/suite/roles/create_and_drop_role.test
mysql-test/suite/roles/create_and_drop_role.test
+8
-1
sql/sql_acl.cc
sql/sql_acl.cc
+1
-1
No files found.
mysql-test/suite/roles/create_and_drop_role.result
View file @
03b428d2
...
@@ -34,3 +34,5 @@ ERROR HY000: Operation DROP ROLE failed for 'dummy'
...
@@ -34,3 +34,5 @@ ERROR HY000: Operation DROP ROLE failed for 'dummy'
drop user dummy@'';
drop user dummy@'';
select user, host, is_role from user where user like 'test%';
select user, host, is_role from user where user like 'test%';
user host is_role
user host is_role
create role '';
ERROR OP000: Invalid role specification ``.
mysql-test/suite/roles/create_and_drop_role.test
View file @
03b428d2
...
@@ -18,7 +18,6 @@ select user, host, is_role from user where user like 'test%';
...
@@ -18,7 +18,6 @@ select user, host, is_role from user where user like 'test%';
drop
role
test_role1
;
drop
role
test_role1
;
drop
role
test_role2
,
test_role3
;
drop
role
test_role2
,
test_role3
;
create
role
test_role1
;
create
role
test_role1
;
--
error
ER_CANNOT_USER
--
error
ER_CANNOT_USER
create
role
test_role1
;
create
role
test_role1
;
...
@@ -45,3 +44,11 @@ drop user dummy@'';
...
@@ -45,3 +44,11 @@ drop user dummy@'';
--
sorted_result
--
sorted_result
select
user
,
host
,
is_role
from
user
where
user
like
'test%'
;
select
user
,
host
,
is_role
from
user
where
user
like
'test%'
;
disconnect
mysql
;
disconnect
mysql
;
connection
default
;
#
# MDEV-5520 Connection lost on wrong CREATE ROLE
#
--
error
ER_INVALID_ROLE
create
role
''
;
sql/sql_acl.cc
View file @
03b428d2
...
@@ -800,7 +800,7 @@ ACL_ROLE::ACL_ROLE(const char * rolename, ulong privileges, MEM_ROOT *root) :
...
@@ -800,7 +800,7 @@ ACL_ROLE::ACL_ROLE(const char * rolename, ulong privileges, MEM_ROOT *root) :
static
bool
is_invalid_role_name
(
const
char
*
str
)
static
bool
is_invalid_role_name
(
const
char
*
str
)
{
{
if
(
strcasecmp
(
str
,
"PUBLIC"
)
&&
strcasecmp
(
str
,
"NONE"
))
if
(
*
str
&&
strcasecmp
(
str
,
"PUBLIC"
)
&&
strcasecmp
(
str
,
"NONE"
))
return
false
;
return
false
;
my_error
(
ER_INVALID_ROLE
,
MYF
(
0
),
str
);
my_error
(
ER_INVALID_ROLE
,
MYF
(
0
),
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