Below is the list of changes that have just been committed into a local
5.0 repository of alik. When alik does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2064 06/02/20 15:35:47 anozdrin@stripped +3 -0
Fix for BUG#7787: Stored procedures: improper warning for "grant execute" statement.
The problem was that error flag was not reset.
sql/sp.cc
1.107 06/02/20 15:35:44 anozdrin@stripped +7 -4
Reset errors after sp_find_routine().
mysql-test/t/sp-security.test
1.29 06/02/20 15:35:44 anozdrin@stripped +22 -0
A test case for BUG#7787.
mysql-test/r/sp-security.result
1.26 06/02/20 15:35:44 anozdrin@stripped +9 -0
Results for test case for BUG#7787.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: anozdrin
# Host: station.home
# Root: /home/alik/Documents/AllProgs/MySQL/devel/5.0-bug7787
--- 1.25/mysql-test/r/sp-security.result 2006-02-01 16:46:26 +03:00
+++ 1.26/mysql-test/r/sp-security.result 2006-02-20 15:35:44 +03:00
@@ -314,3 +314,12 @@
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;
--- 1.28/mysql-test/t/sp-security.test 2006-02-01 16:46:26 +03:00
+++ 1.29/mysql-test/t/sp-security.test 2006-02-20 15:35:44 +03:00
@@ -525,4 +525,26 @@
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.
--- 1.106/sql/sp.cc 2006-02-02 17:37:25 +03:00
+++ 1.107/sql/sp.cc 2006-02-20 15:35:44 +03:00
@@ -1012,6 +1012,7 @@
{
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 @@
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);
| Thread |
|---|
| • bk commit into 5.0 tree (anozdrin:1.2064) BUG#7787 | Alexander Nozdrin | 20 Feb |