diff options
Diffstat (limited to 'strings/ctype-bin.c')
-rw-r--r-- | strings/ctype-bin.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 7848862a0db..e20afff1470 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -47,8 +47,8 @@ static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)), const uchar *s, uint slen, const uchar *t, uint tlen) { - int len = ( slen > tlen ) ? tlen : slen; - return memcmp(s,t,len); + int cmp= memcmp(s,t,min(slen,tlen)); + return cmp ? cmp : (int) (slen - tlen); } static void my_caseup_str_bin(CHARSET_INFO *cs __attribute__((unused)), @@ -259,7 +259,8 @@ static int my_wildcmp_bin(CHARSET_INFO *cs, static CHARSET_INFO my_charset_bin_st = { 63, /* number */ - MY_CS_COMPILED|MY_CS_BINSORT,/* state */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PRIMARY,/* state */ + "binary", /* cs name */ "binary", /* name */ "", /* comment */ ctype_bin, /* ctype */ |