summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy10
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;