summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-02-12 17:30:38 +0200
committerGeorgi Kodinov <joro@sun.com>2009-02-12 17:30:38 +0200
commitcc5809f055ada86c58be2d76cc6dff5fcb07f338 (patch)
tree28e814cb1f75bb2d8978d6343d7940ba18bd7f20
parent984c2489d11455d5c4cfaf25fd18e062970d96a9 (diff)
parent47c53135fdf8af0fdb4324cae38e67e10dfd201d (diff)
downloadmariadb-git-cc5809f055ada86c58be2d76cc6dff5fcb07f338.tar.gz
merged additional fix for bug 33813 to 5.1-bugteam
-rw-r--r--sql/sql_yacc.yy38
1 files changed, 35 insertions, 3 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 3b142de4175..588c4334b84 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -9256,9 +9256,16 @@ drop:
lex->drop_if_exists=$3;
lex->name= $4;
}
- | DROP FUNCTION_SYM if_exists sp_name
+ | DROP FUNCTION_SYM if_exists ident '.' ident
{
- LEX *lex=Lex;
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ sp_name *spname;
+ if ($4.str && check_db_name(&$4))
+ {
+ my_error(ER_WRONG_DB_NAME, MYF(0), $4.str);
+ MYSQL_YYABORT;
+ }
if (lex->sphead)
{
my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
@@ -9266,7 +9273,32 @@ drop:
}
lex->sql_command = SQLCOM_DROP_FUNCTION;
lex->drop_if_exists= $3;
- lex->spname= $4;
+ spname= new sp_name($4, $6, true);
+ if (spname == NULL)
+ MYSQL_YYABORT;
+ spname->init_qname(thd);
+ lex->spname= spname;
+ }
+ | DROP FUNCTION_SYM if_exists ident
+ {
+ THD *thd= YYTHD;
+ LEX *lex= thd->lex;
+ LEX_STRING db= {0, 0};
+ sp_name *spname;
+ if (lex->sphead)
+ {
+ my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
+ MYSQL_YYABORT;
+ }
+ if (thd->db && lex->copy_db_to(&db.str, &db.length))
+ MYSQL_YYABORT;
+ lex->sql_command = SQLCOM_DROP_FUNCTION;
+ lex->drop_if_exists= $3;
+ spname= new sp_name(db, $4, false);
+ if (spname == NULL)
+ MYSQL_YYABORT;
+ spname->init_qname(thd);
+ lex->spname= spname;
}
| DROP PROCEDURE if_exists sp_name
{