summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-02-28 19:39:30 +0200
committerMichael Widenius <monty@askmonty.org>2011-02-28 19:39:30 +0200
commit3358cdd5048671ee6cbbf50c291f7e0d0fda8e1e (patch)
treeda0e622896425203d23ecdfd1bc77b57e3502edf /sql/sql_acl.cc
parent869f5d0e81d5cbecaec3605f292fbb363b9ccbf6 (diff)
parentf83e594218a6d19da2fa1ea2a01d860c30fe2913 (diff)
downloadmariadb-git-3358cdd5048671ee6cbbf50c291f7e0d0fda8e1e.tar.gz
Merge with 5.1 to get in changes from MySQL 5.1.55
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 9b1d0df4251..47d85238cff 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -7560,6 +7560,19 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
user_len-= 2;
}
+ /*
+ Clip username to allowed length in characters (not bytes). This is
+ mostly for backward compatibility.
+ */
+ {
+ CHARSET_INFO *cs= system_charset_info;
+ int err;
+
+ user_len= (uint) cs->cset->well_formed_len(cs, user, user + user_len,
+ USERNAME_CHAR_LENGTH, &err);
+ user[user_len]= '\0';
+ }
+
Security_context *sctx= thd->security_ctx;
if (thd->make_lex_string(&mpvio->db, db, db_len, 0) == 0)