List:Internals« Previous MessageNext Message »
From:pem Date:April 20 2005 6:19pm
Subject:bk commit into 5.0 tree (pem:1.1861) BUG#7047
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of pem. When pem 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.1861 05/04/20 17:59:28 pem@stripped +4 -0
  Fixed BUG#7047: Stored procedure crash if alter procedure
    by simply disallowing alter procedure/function in an SP (as for drop).

  sql/sql_yacc.yy
    1.365 05/04/20 17:59:22 pem@stripped +10 -0
    Don't allow alter procedure/function in an SP.

  sql/share/errmsg.txt
    1.26 05/04/20 17:59:22 pem@stripped +1 -1
    Modified error message for "update procedure/function" too.

  mysql-test/t/sp-error.test
    1.66 05/04/20 17:59:22 pem@stripped +14 -0
    Added test case for BUG#7047.

  mysql-test/r/sp-error.result
    1.64 05/04/20 17:59:22 pem@stripped +11 -2
    Added test case for BUG#7047.

# 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:	pem
# Host:	mysql.comhem.se
# Root:	/home/pem/work/mysql-5.0

--- 1.364/sql/sql_yacc.yy	Mon Apr 18 11:26:55 2005
+++ 1.365/sql/sql_yacc.yy	Wed Apr 20 17:59:22 2005
@@ -3305,6 +3305,11 @@
 	  {
 	    LEX *lex= Lex;
 
+	    if (lex->sphead)
+	    {
+	      my_error(ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE");
+	      YYABORT;
+	    }
 	    bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
           }
 	  sp_a_chistics
@@ -3318,6 +3323,11 @@
 	  {
 	    LEX *lex= Lex;
 
+	    if (lex->sphead)
+	    {
+	      my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
+	      YYABORT;
+	    }
 	    bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
           }
 	  sp_a_chistics

--- 1.25/sql/share/errmsg.txt	Thu Apr 14 14:52:29 2005
+++ 1.26/sql/share/errmsg.txt	Wed Apr 20 17:59:22 2005
@@ -5213,7 +5213,7 @@
 	eng "View '%-.64s.%-.64s' references invalid table(s) or column(s) or function(s)"
 	rus "View '%-.64s.%-.64s' ссылается на несуществующие таблицы или столбцы или функции"
 ER_SP_NO_DROP_SP  
-	eng "Can't drop a %s from within another stored routine"
+	eng "Can't drop or alter a %s from within another stored routine"
 ER_SP_GOTO_IN_HNDLR  
 	eng "GOTO is not allowed in a stored procedure handler"
 ER_TRG_ALREADY_EXISTS  

--- 1.63/mysql-test/r/sp-error.result	Thu Apr 14 14:52:29 2005
+++ 1.64/mysql-test/r/sp-error.result	Wed Apr 20 17:59:22 2005
@@ -457,9 +457,9 @@
 drop procedure bug2653_1|
 drop procedure bug2653_2|
 create procedure bug4344() drop procedure bug4344|
-ERROR HY000: Can't drop a PROCEDURE from within another stored routine
+ERROR HY000: Can't drop or alter a PROCEDURE from within another stored routine
 create procedure bug4344() drop function bug4344|
-ERROR HY000: Can't drop a FUNCTION from within another stored routine
+ERROR HY000: Can't drop or alter a FUNCTION from within another stored routine
 drop procedure if exists bug3294|
 create procedure bug3294()
 begin
@@ -585,4 +585,13 @@
 end;
 end|
 drop procedure bug9073|
+create procedure bug7047()
+alter procedure bug7047|
+ERROR HY000: Can't drop or alter a PROCEDURE from within another stored routine
+create function bug7047() returns int
+begin
+alter function bug7047;
+return 0;
+end|
+ERROR HY000: Can't drop or alter a FUNCTION from within another stored routine
 drop table t1|

--- 1.65/mysql-test/t/sp-error.test	Thu Apr 14 14:52:29 2005
+++ 1.66/mysql-test/t/sp-error.test	Wed Apr 20 17:59:22 2005
@@ -818,6 +818,20 @@
 
 
 #
+# BUG#7047: Stored procedure crash if alter procedure
+#
+--error ER_SP_NO_DROP_SP
+create procedure bug7047()
+  alter procedure bug7047|
+--error ER_SP_NO_DROP_SP
+create function bug7047() returns int
+begin
+  alter function bug7047;
+  return 0;
+end|
+
+
+#
 # BUG#NNNN: New bug synopsis
 #
 #--disable_warnings
Thread
bk commit into 5.0 tree (pem:1.1861) BUG#7047pem20 Apr