Commit b60fc2ce authored by unknown's avatar unknown

Post-review fixes (BUG#15658).


sql/sp_head.cc:
  Post-review fix.
sql/sp_head.h:
  Post-review fix.
sql/sql_yacc.yy:
  Post-review fix.
parent 76c1f674
...@@ -387,19 +387,19 @@ sp_name_current_db_new(THD *thd, LEX_STRING name) ...@@ -387,19 +387,19 @@ sp_name_current_db_new(THD *thd, LEX_STRING name)
} }
/* /*
* Check that the name 'ident' is ok. It's assumed to be an 'ident' Check that the name 'ident' is ok. It's assumed to be an 'ident'
* from the parser, so we only have to check length and trailing spaces. from the parser, so we only have to check length and trailing spaces.
* The former is a standard requirement (and 'show status' assumes a The former is a standard requirement (and 'show status' assumes a
* non-empty name), the latter is a mysql:ism as trailing spaces are non-empty name), the latter is a mysql:ism as trailing spaces are
* removed by get_field(). removed by get_field().
*
* RETURN RETURN
* TRUE - bad name TRUE - bad name
* FALSE - name is ok FALSE - name is ok
*/ */
bool bool
sp_name_check(LEX_STRING ident) check_routine_name(LEX_STRING ident)
{ {
return (!ident.str || !ident.str[0] || ident.str[ident.length-1] == ' '); return (!ident.str || !ident.str[0] || ident.str[ident.length-1] == ' ');
} }
......
...@@ -104,7 +104,7 @@ sp_name * ...@@ -104,7 +104,7 @@ sp_name *
sp_name_current_db_new(THD *thd, LEX_STRING name); sp_name_current_db_new(THD *thd, LEX_STRING name);
bool bool
sp_name_check(LEX_STRING name); check_routine_name(LEX_STRING name);
class sp_head :private Query_arena class sp_head :private Query_arena
{ {
......
...@@ -1293,7 +1293,7 @@ sp_name: ...@@ -1293,7 +1293,7 @@ sp_name:
my_error(ER_WRONG_DB_NAME, MYF(0), $1.str); my_error(ER_WRONG_DB_NAME, MYF(0), $1.str);
YYABORT; YYABORT;
} }
if (sp_name_check($3)) if (check_routine_name($3))
{ {
my_error(ER_SP_WRONG_NAME, MYF(0), $3.str); my_error(ER_SP_WRONG_NAME, MYF(0), $3.str);
YYABORT; YYABORT;
...@@ -1303,7 +1303,7 @@ sp_name: ...@@ -1303,7 +1303,7 @@ sp_name:
} }
| ident | ident
{ {
if (sp_name_check($1)) if (check_routine_name($1))
{ {
my_error(ER_SP_WRONG_NAME, MYF(0), $1.str); my_error(ER_SP_WRONG_NAME, MYF(0), $1.str);
YYABORT; YYABORT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment