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
a77cc69e
Commit
a77cc69e
authored
Feb 22, 2006
by
anozdrin@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for BUG#7787: Stored procedures: improper warning for "grant execute" statement.
The problem was that error flag was not reset.
parent
f0abdf1e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
4 deletions
+38
-4
mysql-test/r/sp-security.result
mysql-test/r/sp-security.result
+9
-0
mysql-test/t/sp-security.test
mysql-test/t/sp-security.test
+22
-0
sql/sp.cc
sql/sp.cc
+7
-4
No files found.
mysql-test/r/sp-security.result
View file @
a77cc69e
...
...
@@ -314,3 +314,12 @@ select * from db_bug14533.t1;
ERROR 42000: SELECT command denied to user 'user_bug14533'@'localhost' for table 't1'
drop user user_bug14533@localhost;
drop database db_bug14533;
CREATE DATABASE db_bug7787;
use db_bug7787;
CREATE PROCEDURE p1()
SHOW INNODB STATUS;
Warnings:
Warning 1287 'SHOW INNODB STATUS' is deprecated; use 'SHOW ENGINE INNODB STATUS' instead
GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost;
DROP DATABASE db_bug7787;
use test;
mysql-test/t/sp-security.test
View file @
a77cc69e
...
...
@@ -525,4 +525,26 @@ disconnect user_bug14533;
drop
user
user_bug14533
@
localhost
;
drop
database
db_bug14533
;
#
# BUG#7787: Stored procedures: improper warning for "grant execute" statement
#
# Prepare.
CREATE
DATABASE
db_bug7787
;
use
db_bug7787
;
# Test.
CREATE
PROCEDURE
p1
()
SHOW
INNODB
STATUS
;
GRANT
EXECUTE
ON
PROCEDURE
p1
TO
user_bug7787
@
localhost
;
# Cleanup.
DROP
DATABASE
db_bug7787
;
use
test
;
# End of 5.0 bugs.
sql/sp.cc
View file @
a77cc69e
...
...
@@ -1012,6 +1012,7 @@ sp_exist_routines(THD *thd, TABLE_LIST *routines, bool any, bool no_error)
{
TABLE_LIST
*
routine
;
bool
result
=
0
;
bool
sp_object_found
;
DBUG_ENTER
(
"sp_exists_routine"
);
for
(
routine
=
routines
;
routine
;
routine
=
routine
->
next_global
)
{
...
...
@@ -1024,10 +1025,12 @@ sp_exist_routines(THD *thd, TABLE_LIST *routines, bool any, bool no_error)
lex_name
.
str
=
thd
->
strmake
(
routine
->
table_name
,
lex_name
.
length
);
name
=
new
sp_name
(
lex_db
,
lex_name
);
name
->
init_qname
(
thd
);
if
(
sp_find_routine
(
thd
,
TYPE_ENUM_PROCEDURE
,
name
,
&
thd
->
sp_proc_cache
,
FALSE
)
!=
NULL
||
sp_find_routine
(
thd
,
TYPE_ENUM_FUNCTION
,
name
,
&
thd
->
sp_func_cache
,
FALSE
)
!=
NULL
)
sp_object_found
=
sp_find_routine
(
thd
,
TYPE_ENUM_PROCEDURE
,
name
,
&
thd
->
sp_proc_cache
,
FALSE
)
!=
NULL
||
sp_find_routine
(
thd
,
TYPE_ENUM_FUNCTION
,
name
,
&
thd
->
sp_func_cache
,
FALSE
)
!=
NULL
;
mysql_reset_errors
(
thd
,
TRUE
);
if
(
sp_object_found
)
{
if
(
any
)
DBUG_RETURN
(
1
);
...
...
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