summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorgluh@mysql.com/gluh.(none) <>2006-08-30 15:56:17 +0500
committergluh@mysql.com/gluh.(none) <>2006-08-30 15:56:17 +0500
commitaf9895d4c2fa7787e7024a0fead11aa890ac0d5f (patch)
treebadf8f73c40042fa5b387f7c6af18f4e9f4f7696 /sql/table.cc
parent109d58af66528bfed7dbea6d56308d356319e2bb (diff)
downloadmariadb-git-af9895d4c2fa7787e7024a0fead11aa890ac0d5f.tar.gz
Bug#20393 User name truncation in mysql client
Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 29e7d5ebf26..7587531b2f9 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1413,7 +1413,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;
@@ -1430,6 +1430,7 @@ bool check_db_name(char *name)
name+system_charset_info->mbmaxlen);
if (len)
{
+ name_length++;
name += len;
continue;
}
@@ -1437,12 +1438,13 @@ bool check_db_name(char *name)
#else
last_char_is_space= *name==' ';
#endif
+ name_length++;
if (*name == '/' || *name == '\\' || *name == FN_LIBCHAR ||
*name == FN_EXTCHAR)
return 1;
name++;
}
- return last_char_is_space || (uint) (name - start) > NAME_LEN;
+ return (last_char_is_space || name_length > NAME_LEN);
}