diff options
author | unknown <pem@mysql.com> | 2006-03-28 15:06:06 +0200 |
---|---|---|
committer | unknown <pem@mysql.com> | 2006-03-28 15:06:06 +0200 |
commit | e550d6e7e3d73d3c2e3236036cff977545c39d4d (patch) | |
tree | 806a9c1f278cf9eda9bb79241459e29fdaa9b35f /sql/field.h | |
parent | 8dd6e1454a0cf0cc4e974c9dd8f71e77cf7e8a68 (diff) | |
download | mariadb-git-e550d6e7e3d73d3c2e3236036cff977545c39d4d.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/field.h')
-rw-r--r-- | sql/field.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/field.h b/sql/field.h index 218308ead13..c32f365ec92 100644 --- a/sql/field.h +++ b/sql/field.h @@ -319,6 +319,12 @@ public: /* convert decimal to longlong with overflow check */ longlong convert_decimal2longlong(const my_decimal *val, bool unsigned_flag, int *err); + /* The max. number of characters */ + inline uint32 Field::char_length() const + { + return field_length / charset()->mbmaxlen; + } + friend bool reopen_table(THD *,struct st_table *,bool); friend int cre_myisam(my_string name, register TABLE *form, uint options, ulonglong auto_increment_value); |