summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
authorunknown <pem@mysql.com>2006-03-28 15:06:06 +0200
committerunknown <pem@mysql.com>2006-03-28 15:06:06 +0200
commit53b9b17b720a36a20ed73b9b91629e3955c07471 (patch)
tree806a9c1f278cf9eda9bb79241459e29fdaa9b35f /sql/sp.cc
parentc0c2d99e4aa717d292f07ac0ec87562c91e6d516 (diff)
downloadmariadb-git-53b9b17b720a36a20ed73b9b91629e3955c07471.tar.gz
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.
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index 53218aece56..93dfd68cef3 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -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;