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
1b666071
Commit
1b666071
authored
Aug 12, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.0
into gw.mysql.r18.ru:/usr/home/ram/work/4.0.b4898
parents
acf5df3a
6bd68efa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
5 deletions
+46
-5
mysql-test/r/grant.result
mysql-test/r/grant.result
+18
-0
mysql-test/t/grant.test
mysql-test/t/grant.test
+15
-0
sql/sql_acl.cc
sql/sql_acl.cc
+13
-5
No files found.
mysql-test/r/grant.result
View file @
1b666071
...
@@ -131,3 +131,21 @@ Wrong usage of DB GRANT and GLOBAL PRIVILEGES
...
@@ -131,3 +131,21 @@ Wrong usage of DB GRANT and GLOBAL PRIVILEGES
select 1;
select 1;
1
1
1
1
insert into mysql.user (host, user) values ('localhost', 'test11');
insert into mysql.db (host, db, user, select_priv) values
('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
flush privileges;
show grants for test11@localhost;
Grants for test11@localhost
GRANT USAGE ON *.* TO 'test11'@'localhost'
GRANT SELECT ON `ab%`.* TO 'test11'@'localhost'
GRANT SELECT ON `a%`.* TO 'test11'@'localhost'
alter table mysql.db order by db desc;
flush privileges;
show grants for test11@localhost;
Grants for test11@localhost
GRANT USAGE ON *.* TO 'test11'@'localhost'
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';
mysql-test/t/grant.test
View file @
1b666071
...
@@ -89,3 +89,18 @@ drop table t1;
...
@@ -89,3 +89,18 @@ drop table t1;
--
error
1221
--
error
1221
GRANT
FILE
on
mysqltest
.*
to
mysqltest_1
@
localhost
;
GRANT
FILE
on
mysqltest
.*
to
mysqltest_1
@
localhost
;
select
1
;
--
To
test
that
the
previous
command
didn
't cause problems
select
1
;
--
To
test
that
the
previous
command
didn
't cause problems
#
# Bug #4898: User privileges depending on ORDER BY Settings of table db
#
insert into mysql.user (host, user) values ('
localhost
', '
test11
');
insert into mysql.db (host, db, user, select_priv) values
('
localhost
', '
a
%
', '
test11
', '
Y
'), ('
localhost
', '
ab
%
', '
test11
', '
Y
');
flush privileges;
show grants for test11@localhost;
alter table mysql.db order by db desc;
flush privileges;
show grants for test11@localhost;
delete from mysql.user where user='
test11
';
delete from mysql.db where user='
test11
'
;
sql/sql_acl.cc
View file @
1b666071
...
@@ -460,22 +460,30 @@ static ulong get_sort(uint count,...)
...
@@ -460,22 +460,30 @@ static ulong get_sort(uint count,...)
va_start
(
args
,
count
);
va_start
(
args
,
count
);
ulong
sort
=
0
;
ulong
sort
=
0
;
/* Should not use this function with more than 4 arguments for compare. */
DBUG_ASSERT
(
count
<=
4
);
while
(
count
--
)
while
(
count
--
)
{
{
char
*
str
=
va_arg
(
args
,
char
*
);
char
*
start
,
*
str
=
va_arg
(
args
,
char
*
);
uint
chars
=
0
,
wild
=
0
;
uint
chars
=
0
;
uint
wild_pos
=
0
;
/* first wildcard position */
if
(
str
)
if
(
st
art
=
st
r
)
{
{
for
(;
*
str
;
str
++
)
for
(;
*
str
;
str
++
)
{
{
if
(
*
str
==
wild_many
||
*
str
==
wild_one
||
*
str
==
wild_prefix
)
if
(
*
str
==
wild_many
||
*
str
==
wild_one
||
*
str
==
wild_prefix
)
wild
++
;
{
wild_pos
=
str
-
start
+
1
;
break
;
}
else
else
chars
++
;
chars
++
;
}
}
}
}
sort
=
(
sort
<<
8
)
+
(
wild
?
1
:
chars
?
2
:
0
);
sort
=
(
sort
<<
8
)
+
(
wild_pos
?
(
wild_pos
>
127
?
127
:
wild_pos
)
:
(
chars
?
128
:
0
));
}
}
va_end
(
args
);
va_end
(
args
);
return
sort
;
return
sort
;
...
...
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