diff options
-rw-r--r-- | client/mysql.cc | 3 | ||||
-rw-r--r-- | include/m_ctype.h | 7 | ||||
-rw-r--r-- | mysys/charset.c | 2 | ||||
-rw-r--r-- | mysys/hash.c | 2 | ||||
-rw-r--r-- | sql/slave.cc | 2 | ||||
-rw-r--r-- | sql/spatial.cc | 3 | ||||
-rw-r--r-- | strings/ctype-big5.c | 1 | ||||
-rw-r--r-- | strings/ctype-bin.c | 7 | ||||
-rw-r--r-- | strings/ctype-czech.c | 1 | ||||
-rw-r--r-- | strings/ctype-euc_kr.c | 1 | ||||
-rw-r--r-- | strings/ctype-extra.c | 1 | ||||
-rw-r--r-- | strings/ctype-gb2312.c | 1 | ||||
-rw-r--r-- | strings/ctype-gbk.c | 1 | ||||
-rw-r--r-- | strings/ctype-latin1.c | 2 | ||||
-rw-r--r-- | strings/ctype-mb.c | 24 | ||||
-rw-r--r-- | strings/ctype-simple.c | 8 | ||||
-rw-r--r-- | strings/ctype-sjis.c | 1 | ||||
-rw-r--r-- | strings/ctype-tis620.c | 1 | ||||
-rw-r--r-- | strings/ctype-ujis.c | 1 | ||||
-rw-r--r-- | strings/ctype-utf8.c | 2 | ||||
-rw-r--r-- | strings/ctype-win1250ch.c | 1 |
21 files changed, 7 insertions, 65 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 9720a4ada9d..264fd5a4605 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -939,7 +939,8 @@ static COMMANDS *find_command (char *name,char cmd_char) { if (commands[i].func && ((name && - !my_strncasecmp(charset_info,name,commands[i].name,len) && + !my_strnncoll(charset_info,(uchar*)name,len, + (uchar*)commands[i].name,len) && !commands[i].name[len] && (!end || (end && commands[i].takes_params))) || !name && commands[i].cmd_char == cmd_char)) diff --git a/include/m_ctype.h b/include/m_ctype.h index f6a70d72c19..cf61c2e49e3 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -150,8 +150,6 @@ typedef struct charset_info_st /* Functions for case comparison */ int (*strcasecmp)(struct charset_info_st *, const char *, const char *); - int (*strncasecmp)(struct charset_info_st *, const char *, const char *, - uint); /* Hash calculation */ void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len, @@ -228,8 +226,6 @@ extern void my_caseup_8bit(CHARSET_INFO *, char *, uint); extern void my_casedn_8bit(CHARSET_INFO *, char *, uint); extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *); -extern int my_strncasecmp_8bit(CHARSET_INFO * cs, const char *, const char *, - uint); int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e); int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e); @@ -281,8 +277,7 @@ extern void my_casedn_str_mb(CHARSET_INFO *, char *); extern void my_caseup_mb(CHARSET_INFO *, char *, uint); extern void my_casedn_mb(CHARSET_INFO *, char *, uint); extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *); -extern int my_strncasecmp_mb(CHARSET_INFO * cs,const char *, const char *t, - uint); + int my_wildcmp_mb(CHARSET_INFO *, const char *str,const char *str_end, const char *wildstr,const char *wildend, diff --git a/mysys/charset.c b/mysys/charset.c index 1c19960b197..1f8c20f45f0 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -127,7 +127,6 @@ static void simple_cs_init_functions(CHARSET_INFO *cs) cs->strnncoll = b->strnncoll; cs->strnncollsp = b->strnncollsp; cs->strcasecmp = b->strcasecmp; - cs->strncasecmp = b->strncasecmp; cs->hash_sort = b->hash_sort; } else @@ -138,7 +137,6 @@ static void simple_cs_init_functions(CHARSET_INFO *cs) cs->strnncoll = my_strnncoll_simple; cs->strnncollsp = my_strnncollsp_simple; cs->strcasecmp = my_strcasecmp_8bit; - cs->strncasecmp = my_strncasecmp_8bit; cs->hash_sort = my_hash_sort_simple; } diff --git a/mysys/hash.c b/mysys/hash.c index abff6694af9..9169613c39f 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -211,7 +211,7 @@ static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length) uint rec_keylength; byte *rec_key= (byte*) hash_key(hash,pos->data,&rec_keylength,1); return (length && length != rec_keylength) || - my_strncasecmp(hash->charset, rec_key,key,rec_keylength); + my_strnncoll(hash->charset, rec_key, rec_keylength, key, length); } diff --git a/sql/slave.cc b/sql/slave.cc index eea523a0260..fa7ab180eaa 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -334,7 +334,7 @@ void init_slave_skip_errors(const char* arg) use_slave_mask = 1; for (;my_isspace(system_charset_info,*arg);++arg) /* empty */; - if (!my_strncasecmp(system_charset_info,arg,"all",3)) + if (!my_strnncoll(system_charset_info,(uchar*)arg,4,(const uchar*)"all",4)) { bitmap_set_all(&slave_error_mask); return; diff --git a/sql/spatial.cc b/sql/spatial.cc index df28733782f..c8dfb490a39 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -66,7 +66,8 @@ Geometry::GClassInfo *Geometry::find_class(const char *name, size_t len) cur_rt < ci_collection_end; ++cur_rt) { if ((cur_rt->m_name[len] == 0) && - (my_strncasecmp(&my_charset_latin1, cur_rt->m_name, name, len) == 0)) + (my_strnncoll(&my_charset_latin1, (const uchar*)cur_rt->m_name, len, + (const uchar*)name, len) == 0)) { return cur_rt; } diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index c25e3aa79e0..43d6f1a8e13 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -6264,7 +6264,6 @@ CHARSET_INFO my_charset_big5 = my_caseup_mb, my_casedn_mb, my_strcasecmp_mb, - my_strncasecmp_mb, my_hash_sort_simple, 0, my_snprintf_8bit, diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 432550e4e4c..568165896ca 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -118,12 +118,6 @@ static int my_strcasecmp_bin(CHARSET_INFO * cs __attribute__((unused)), return strcmp(s,t); } -static int my_strncasecmp_bin(CHARSET_INFO * cs __attribute__((unused)), - const char *s, const char *t, uint len) -{ - return memcmp(s,t,len); -} - static int my_mb_wc_bin(CHARSET_INFO *cs __attribute__((unused)), my_wc_t *wc, const unsigned char *str, @@ -301,7 +295,6 @@ CHARSET_INFO my_charset_bin = my_caseup_bin, /* caseup */ my_casedn_bin, /* casedn */ my_strcasecmp_bin, /* strcasecmp */ - my_strncasecmp_bin, /* strncasecmp */ my_hash_sort_bin, /* hash_sort */ (char) 255, /* max_sort_char */ my_snprintf_8bit, /* snprintf */ diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index e52eedf737f..0ff7718b6d8 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -638,7 +638,6 @@ CHARSET_INFO my_charset_czech = my_caseup_8bit, my_casedn_8bit, my_strcasecmp_8bit, - my_strncasecmp_8bit, my_hash_sort_simple, 0, my_snprintf_8bit, diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index 991bf9cb690..5b1240e1a92 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -8672,7 +8672,6 @@ CHARSET_INFO my_charset_euc_kr = my_caseup_mb, my_casedn_mb, my_strcasecmp_mb, - my_strncasecmp_mb, my_hash_sort_simple, 0, my_snprintf_8bit, diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c index 8690f20d6de..60934d5ff55 100644 --- a/strings/ctype-extra.c +++ b/strings/ctype-extra.c @@ -62,7 +62,6 @@ CHARSET_INFO compiled_charsets[] = { NULL, NULL, NULL, - NULL, NULL } }; diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index 57d227d147f..4d0fdda5c6e 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -5722,7 +5722,6 @@ CHARSET_INFO my_charset_gb2312 = my_caseup_mb, my_casedn_mb, my_strcasecmp_mb, - my_strncasecmp_mb, my_hash_sort_simple, 0, my_snprintf_8bit, diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index 9c018c4e569..c39ef62b97c 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -9919,7 +9919,6 @@ CHARSET_INFO my_charset_gbk = my_caseup_mb, my_casedn_mb, my_strcasecmp_mb, - my_strncasecmp_mb, my_hash_sort_simple, 0, my_snprintf_8bit, diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index d561c82ed7d..d626d7c4464 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -208,7 +208,6 @@ CHARSET_INFO my_charset_latin1 = my_caseup_8bit, my_casedn_8bit, my_strcasecmp_8bit, - my_strncasecmp_8bit, my_hash_sort_simple, 0, my_snprintf_8bit, @@ -463,7 +462,6 @@ CHARSET_INFO my_charset_latin1_de = my_caseup_8bit, my_casedn_8bit, my_strcasecmp_8bit, - my_strncasecmp_8bit, my_hash_sort_simple, 0, my_snprintf_8bit, diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index 4c1f791b8e4..625dbbae751 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -116,30 +116,6 @@ int my_strcasecmp_mb(CHARSET_INFO * cs,const char *s, const char *t) } -int my_strncasecmp_mb(CHARSET_INFO * cs, - const char *s, const char *t, uint len) -{ - register uint32 l; - register const char *end=s+len; - register uchar *map=cs->to_upper; - - while (s<end) - { - if ((l=my_ismbchar(cs, s,end))) - { - while (l--) - if (*s++ != *t++) - return 1; - } - else if (my_ismbhead(cs, *t)) - return 1; - else if (map[(uchar) *s++] != map[(uchar) *t++]) - return 1; - } - return 0; -} - - /* ** Compare string against string with wildcard ** 0 if matched diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index cab7c4a0267..7d8f5b9535b 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -116,14 +116,6 @@ int my_strcasecmp_8bit(CHARSET_INFO * cs,const char *s, const char *t) } -int my_strncasecmp_8bit(CHARSET_INFO * cs, - const char *s, const char *t, uint len) -{ - register uchar *map=cs->to_upper; - while (len-- != 0 && map[(uchar)*s++] == map[(uchar)*t++]) ; - return (int) len+1; -} - int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const unsigned char *str, const unsigned char *end __attribute__((unused))) diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index 036296efe32..5fc0d3f069a 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -4506,7 +4506,6 @@ CHARSET_INFO my_charset_sjis = my_caseup_8bit, my_casedn_8bit, my_strcasecmp_8bit, - my_strncasecmp_8bit, my_hash_sort_simple, 0, my_snprintf_8bit, diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 1a5758a3e99..d08faa2e6c6 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -729,7 +729,6 @@ CHARSET_INFO my_charset_tis620 = my_caseup_8bit, my_casedn_8bit, my_strcasecmp_8bit, - my_strncasecmp_8bit, my_hash_sort_simple, 0, my_snprintf_8bit, diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index dba87c6d692..88f0f67ec1b 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -8463,7 +8463,6 @@ CHARSET_INFO my_charset_ujis = my_caseup_mb, my_casedn_mb, my_strcasecmp_mb, - my_strncasecmp_mb, my_hash_sort_simple, 0, my_snprintf_8bit, diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 7657abf5f19..0f784fe26c0 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -1988,7 +1988,6 @@ CHARSET_INFO my_charset_utf8 = my_caseup_utf8, my_casedn_utf8, my_strcasecmp_utf8, - my_strncasecmp_utf8, my_hash_sort_utf8, /* hash_sort */ 0, my_snprintf_8bit, @@ -3071,7 +3070,6 @@ CHARSET_INFO my_charset_ucs2 = my_caseup_ucs2, my_casedn_ucs2, my_strcasecmp_ucs2, - my_strncasecmp_ucs2, my_hash_sort_ucs2, /* hash_sort */ 0, my_snprintf_ucs2, diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index 951f4b4c80e..dea4a096006 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -673,7 +673,6 @@ CHARSET_INFO my_charset_win1250ch = my_caseup_8bit, my_casedn_8bit, my_strcasecmp_8bit, - my_strncasecmp_8bit, my_hash_sort_simple, 0, my_snprintf_8bit, |