Review fix for BUG#17015: Routine name truncation not an error

sql/field.h:
  Added new method to Field class: char_length()
sql/sp.cc:
  Use Field::char_length() to check number of characters in the name field.
This commit is contained in:
unknown 2006-03-28 15:06:06 +02:00
commit e550d6e7e3
2 changed files with 10 additions and 5 deletions

View file

@ -509,11 +509,10 @@ db_create_routine(THD *thd, int type, sp_head *sp)
goto done;
}
if ((system_charset_info->cset->numchars(system_charset_info,
sp->m_name.str,
sp->m_name.str+sp->m_name.length) *
table->field[MYSQL_PROC_FIELD_NAME]->charset()->mbmaxlen) >
table->field[MYSQL_PROC_FIELD_NAME]->field_length)
if (system_charset_info->cset->numchars(system_charset_info,
sp->m_name.str,
sp->m_name.str+sp->m_name.length) >
table->field[MYSQL_PROC_FIELD_NAME]->char_length())
{
ret= SP_BAD_IDENTIFIER;
goto done;