summaryrefslogtreecommitdiff
path: root/strings/ctype-simple.c
diff options
context:
space:
mode:
authorbar@mysql.com <>2005-07-06 17:16:22 +0500
committerbar@mysql.com <>2005-07-06 17:16:22 +0500
commitd563de7f86e495833c285f906bde326178b4d59e (patch)
tree83522047b7cb27d9ec7bf9c57e42c0106b550c58 /strings/ctype-simple.c
parent58703a4380255e0ea1b7bd977aaffc06e13e3f73 (diff)
downloadmariadb-git-d563de7f86e495833c285f906bde326178b4d59e.tar.gz
ctype_innodb_like.inc:
New BitKeeper file ``mysql-test/include/ctype_innodb_like.inc'' Many files: bug#11650: LIKE pattern matching using prefix index doesn't return correct result min and max values were too long in the case of prefix key. Fix my_like_range functions not to exceed prefix length. ctype_innodb_like.inc: new file
Diffstat (limited to 'strings/ctype-simple.c')
-rw-r--r--strings/ctype-simple.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index bd5131b7448..9e3a328ec26 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -997,9 +997,15 @@ my_bool my_like_range_simple(CHARSET_INFO *cs,
char *min_str,char *max_str,
uint *min_length,uint *max_length)
{
- const char *end=ptr+ptr_length;
+ const char *end;
char *min_org=min_str;
char *min_end=min_str+res_length;
+#ifdef USE_MB
+ uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
+ if (charlen < ptr_length)
+ ptr_length= charlen;
+#endif
+ end= ptr + ptr_length;
for (; ptr != end && min_str != min_end ; ptr++)
{