diff options
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/table.cc b/sql/table.cc index fe83398115d..bcc17fd805b 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2257,7 +2257,7 @@ char *get_field(MEM_ROOT *mem, Field *field) bool check_db_name(char *name) { - char *start=name; + uint name_length= 0; // name length in symbols /* Used to catch empty names and names with end space */ bool last_char_is_space= TRUE; @@ -2277,13 +2277,15 @@ bool check_db_name(char *name) name += len; continue; } + name_length++; } #else last_char_is_space= *name==' '; #endif + name_length++; name++; } - return last_char_is_space || (uint) (name - start) > NAME_LEN; + return last_char_is_space || name_length > NAME_LEN; } |