#At file:///home/kgeorge/mysql/work/B33813-merge-5.0-bugteam/ based on
revid:joro@stripped
2742 Georgi Kodinov 2009-02-12
Bug #33813: Schema names are case-sensitive in DROP FUNCTION
Additional fix:
1. Revert the unification of DROP FUNCTION
and DROP PROCEDURE, because DROP FUNCTION can be used to
drop UDFs (that have a non-qualified name and don't require
database name to be present and valid).
2. Fixed the case sensitivity problem by adding a call to
check_db_name() (similar to the sp_name production).
modified:
sql/sql_yacc.yy
=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy 2009-02-10 09:58:19 +0000
+++ b/sql/sql_yacc.yy 2009-02-12 14:36:43 +0000
@@ -7507,9 +7507,16 @@ drop:
lex->drop_if_exists=$3;
lex->name=$4.str;
}
- | 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.str))
+ {
+ 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");
@@ -7517,7 +7524,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
{
| Thread |
|---|
| • bzr commit into mysql-5.0-bugteam branch (joro:2742) Bug#33813 | Georgi Kodinov | 12 Feb 2009 |