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
030de4f9
Commit
030de4f9
authored
Apr 18, 2006
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge 192.168.0.20:mysql/bug13310/my50-bug13310
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
parents
592dc88b
13062cba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
3 deletions
+50
-3
mysql-test/r/grant2.result
mysql-test/r/grant2.result
+13
-0
mysql-test/t/grant2.test
mysql-test/t/grant2.test
+25
-0
sql/sql_parse.cc
sql/sql_parse.cc
+12
-3
No files found.
mysql-test/r/grant2.result
View file @
030de4f9
...
...
@@ -356,3 +356,16 @@ insert into mysql.user select * from t1;
drop table t1, t2;
drop database TESTDB;
flush privileges;
grant all privileges on test.* to `a@`@localhost;
grant execute on * to `a@`@localhost;
create table t2 (s1 int);
insert into t2 values (1);
drop function if exists f2;
create function f2 () returns int begin declare v int; select s1 from t2
into v; return v; end//
select f2();
f2()
1
drop function f2;
drop table t2;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
mysql-test/t/grant2.test
View file @
030de4f9
...
...
@@ -465,3 +465,28 @@ drop table t1, t2;
drop
database
TESTDB
;
flush
privileges
;
#
# BUG#13310 incorrect user parsing by SP
#
grant
all
privileges
on
test
.*
to
`a@`
@
localhost
;
grant
execute
on
*
to
`a@`
@
localhost
;
connect
(
bug13310
,
localhost
,
'a@'
,,
test
);
connection
bug13310
;
create
table
t2
(
s1
int
);
insert
into
t2
values
(
1
);
--
disable_warnings
drop
function
if
exists
f2
;
--
enable_warnings
delimiter
//;
create
function
f2
()
returns
int
begin
declare
v
int
;
select
s1
from
t2
into
v
;
return
v
;
end
//
delimiter
;
//
select
f2
();
drop
function
f2
;
drop
table
t2
;
disconnect
bug13310
;
connection
default
;
REVOKE
ALL
PRIVILEGES
,
GRANT
OPTION
FROM
`a@`
@
localhost
;
sql/sql_parse.cc
View file @
030de4f9
...
...
@@ -992,6 +992,7 @@ static int check_connection(THD *thd)
char
*
user
=
end
;
char
*
passwd
=
strend
(
user
)
+
1
;
uint
user_len
=
passwd
-
user
-
1
;
char
*
db
=
passwd
;
char
db_buff
[
NAME_LEN
+
1
];
// buffer to store db in utf8
char
user_buff
[
USERNAME_LENGTH
+
1
];
// buffer to store user in utf8
...
...
@@ -1017,11 +1018,19 @@ static int check_connection(THD *thd)
db
=
db_buff
;
}
user_buff
[
copy_and_convert
(
user_buff
,
sizeof
(
user_buff
)
-
1
,
system_charset_info
,
user
,
strlen
(
user
)
,
thd
->
charset
(),
&
dummy_errors
)]
=
'\0'
;
user_buff
[
user_len
=
copy_and_convert
(
user_buff
,
sizeof
(
user_buff
)
-
1
,
system_charset_info
,
user
,
user_len
,
thd
->
charset
(),
&
dummy_errors
)]
=
'\0'
;
user
=
user_buff
;
/* If username starts and ends in "'", chop them off */
if
(
user_len
>
1
&&
user
[
0
]
==
'\''
&&
user
[
user_len
-
1
]
==
'\''
)
{
user
[
user_len
-
1
]
=
0
;
user
++
;
user_len
-=
2
;
}
if
(
thd
->
main_security_ctx
.
user
)
x_free
(
thd
->
main_security_ctx
.
user
);
if
(
!
(
thd
->
main_security_ctx
.
user
=
my_strdup
(
user
,
MYF
(
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