From a07bbd78da6d686e821a3e1daf7f34aeaf1b380f Mon Sep 17 00:00:00 2001 From: "pem@mysql.com" <> Date: Thu, 19 Jan 2006 16:13:04 +0100 Subject: [PATCH] Post-review fixes (BUG#15658). --- sql/sp_head.cc | 22 +++++++++++----------- sql/sp_head.h | 2 +- sql/sql_yacc.yy | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 9c86ebfddf4..f42fbef82e3 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -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' - * from the parser, so we only have to check length and trailing spaces. - * The former is a standard requirement (and 'show status' assumes a - * non-empty name), the latter is a mysql:ism as trailing spaces are - * removed by get_field(). - * - * RETURN - * TRUE - bad name - * FALSE - name is ok - */ + 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. + The former is a standard requirement (and 'show status' assumes a + non-empty name), the latter is a mysql:ism as trailing spaces are + removed by get_field(). + + RETURN + TRUE - bad name + FALSE - name is ok +*/ bool -sp_name_check(LEX_STRING ident) +check_routine_name(LEX_STRING ident) { return (!ident.str || !ident.str[0] || ident.str[ident.length-1] == ' '); } diff --git a/sql/sp_head.h b/sql/sp_head.h index d912cfeaac3..858bf523a07 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -104,7 +104,7 @@ sp_name * sp_name_current_db_new(THD *thd, LEX_STRING name); bool -sp_name_check(LEX_STRING name); +check_routine_name(LEX_STRING name); class sp_head :private Query_arena { diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 2face8238b8..41552100264 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1293,7 +1293,7 @@ sp_name: my_error(ER_WRONG_DB_NAME, MYF(0), $1.str); YYABORT; } - if (sp_name_check($3)) + if (check_routine_name($3)) { my_error(ER_SP_WRONG_NAME, MYF(0), $3.str); YYABORT; @@ -1303,7 +1303,7 @@ sp_name: } | ident { - if (sp_name_check($1)) + if (check_routine_name($1)) { my_error(ER_SP_WRONG_NAME, MYF(0), $1.str); YYABORT;