summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2005-07-22 13:27:30 +0500
committerunknown <bar@mysql.com>2005-07-22 13:27:30 +0500
commitd1e96a25d733c3d17ba564fe77efe8f8bf2a4960 (patch)
treecb883a8fdca69262bc3f87550e01b36168fe50df /strings
parentafd6b4e8ae09e640fcfc16d4a874177c55060ca5 (diff)
parent300d34124c0d3e9e2e55651fe349dacea62baf6d (diff)
downloadmariadb-git-d1e96a25d733c3d17ba564fe77efe8f8bf2a4960.tar.gz
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/usr/home/bar/mysql-4.1.b11754
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-utf8.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index f5192b26ce2..205701e87c7 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -1557,7 +1557,7 @@ int my_wildcmp_unicode(CHARSET_INFO *cs,
}
wildstr+= scan;
- if (w_wc == (my_wc_t)escape)
+ if (w_wc == (my_wc_t)escape && wildstr < wildend)
{
if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
(const uchar*)wildend)) <= 0)
@@ -1629,13 +1629,17 @@ int my_wildcmp_unicode(CHARSET_INFO *cs,
if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
(const uchar*)wildend)) <=0)
return 1;
+ wildstr+= scan;
if (w_wc == (my_wc_t)escape)
{
- wildstr+= scan;
- if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
- (const uchar*)wildend)) <=0)
- return 1;
+ if (wildstr < wildend)
+ {
+ if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend)) <=0)
+ return 1;
+ wildstr+= scan;
+ }
}
while (1)
@@ -1661,14 +1665,12 @@ int my_wildcmp_unicode(CHARSET_INFO *cs,
if (str == str_end)
return -1;
+ str+= scan;
result= my_wildcmp_unicode(cs, str, str_end, wildstr, wildend,
escape, w_one, w_many,
weights);
-
if (result <= 0)
return result;
-
- str+= scan;
}
}
}