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
2ad7d5c6
Commit
2ad7d5c6
authored
Nov 11, 2004
by
acurtis@pcgem.rdg.cyberkinetica.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#6123 - GRANT USAGE creates useless mysql.db row
Prevent creation of a row which grants no rights Test included
parent
54dac2cf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
mysql-test/r/grant.result
mysql-test/r/grant.result
+6
-0
mysql-test/t/grant.test
mysql-test/t/grant.test
+9
-0
sql/sql_acl.cc
sql/sql_acl.cc
+2
-1
No files found.
mysql-test/r/grant.result
View file @
2ad7d5c6
...
...
@@ -150,3 +150,9 @@ GRANT SELECT ON `ab%`.* TO 'test11'@'localhost'
GRANT SELECT ON `a%`.* TO 'test11'@'localhost'
delete from mysql.user where user='test11';
delete from mysql.db where user='test11';
create database db6123;
grant usage on db6123.* to test6123 identified by 'magic123';
select host,db,user,select_priv,insert_priv from mysql.db where db="db6123";
host db user select_priv insert_priv
delete from mysql.user where user='test6123';
drop database db6123;
mysql-test/t/grant.test
View file @
2ad7d5c6
...
...
@@ -105,3 +105,12 @@ flush privileges;
show grants for test11@localhost;
delete from mysql.user where user='
test11
';
delete from mysql.db where user='
test11
';
#
# Bug#6123: GRANT USAGE inserts useless Db row
#
create database db6123;
grant usage on db6123.* to test6123 identified by '
magic123
';
select host,db,user,select_priv,insert_priv from mysql.db where db="db6123";
delete from mysql.user where user='
test6123
'
;
drop
database
db6123
;
sql/sql_acl.cc
View file @
2ad7d5c6
...
...
@@ -1587,7 +1587,7 @@ static int replace_db_table(TABLE *table, const char *db,
goto
table_error
;
/* purecov: deadcode */
}
}
else
if
((
error
=
table
->
file
->
write_row
(
table
->
record
[
0
])))
else
if
(
rights
&&
(
error
=
table
->
file
->
write_row
(
table
->
record
[
0
])))
{
if
(
error
&&
error
!=
HA_ERR_FOUND_DUPP_KEY
)
/* purecov: inspected */
goto
table_error
;
/* purecov: deadcode */
...
...
@@ -1597,6 +1597,7 @@ static int replace_db_table(TABLE *table, const char *db,
if
(
old_row_exists
)
acl_update_db
(
combo
.
user
.
str
,
combo
.
host
.
str
,
db
,
rights
);
else
if
(
rights
)
acl_insert_db
(
combo
.
user
.
str
,
combo
.
host
.
str
,
db
,
rights
);
table
->
file
->
index_end
();
DBUG_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