diff options
author | unknown <pem@mysql.comhem.se> | 2004-07-29 17:33:45 +0200 |
---|---|---|
committer | unknown <pem@mysql.comhem.se> | 2004-07-29 17:33:45 +0200 |
commit | 4467bcf26e0e5f9b205864b5f54f6234c62a2fe3 (patch) | |
tree | 336e25c3c8a62e3ccb35afb0a211bdf731edc791 /sql/sql_yacc.yy | |
parent | 96aeecf23780d45cdc9f8663fe8e85c675d23abf (diff) | |
download | mariadb-git-4467bcf26e0e5f9b205864b5f54f6234c62a2fe3.tar.gz |
Fixed BUG#434: Stored procedure which drops itself causes crash.
Simply disallow it, just as we disallow creation of routines from within
other SPs.
include/mysqld_error.h:
New error code for when attempting to drop a stored routine from within
another stored routine.
mysql-test/r/sp-error.result:
New test case for BUG#4344.
mysql-test/t/sp-error.test:
New test case for BUG#4344.
sql/share/czech/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/danish/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/dutch/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/english/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/estonian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/french/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/german/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/greek/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/hungarian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/italian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/japanese/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/korean/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/norwegian-ny/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/norwegian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/polish/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/portuguese/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/romanian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/russian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/serbian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/slovak/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/spanish/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/swedish/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/ukrainian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/sql_yacc.yy:
Don't allow drop function/procedure from within another function/procedure.
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 2939090e948..e93f2ac089b 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -5187,6 +5187,11 @@ drop: | DROP FUNCTION_SYM if_exists sp_name opt_restrict { LEX *lex=Lex; + if (lex->sphead) + { + net_printf(YYTHD, ER_SP_NO_DROP_SP, "FUNCTION"); + YYABORT; + } lex->sql_command = SQLCOM_DROP_FUNCTION; lex->drop_if_exists= $3; lex->spname= $4; @@ -5194,6 +5199,11 @@ drop: | DROP PROCEDURE if_exists sp_name opt_restrict { LEX *lex=Lex; + if (lex->sphead) + { + net_printf(YYTHD, ER_SP_NO_DROP_SP, "PROCEDURE"); + YYABORT; + } lex->sql_command = SQLCOM_DROP_PROCEDURE; lex->drop_if_exists= $3; lex->spname= $4; |