summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorbar@mysql.com <>2004-08-19 15:15:10 +0500
committerbar@mysql.com <>2004-08-19 15:15:10 +0500
commit2496e85b84aad64a273dcb6ee45bb4a706c4b87d (patch)
tree01ac6df006d72fc8d39e0e1c185bc3c8bc11a7bb /myisam
parent6b90806a4a5ee31ec9f5d9e59f1cd9e722dd1866 (diff)
downloadmariadb-git-2496e85b84aad64a273dcb6ee45bb4a706c4b87d.tar.gz
Bug#4521: unique key prefix interacts poorly with utf8.
Fix for binary collations for MyISAM and HEAP BTREE. This patch also changes trailing spaces behaviour for binary collations. Binary collations now have PAD characteristic too.
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_search.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/myisam/mi_search.c b/myisam/mi_search.c
index 2f1c37e4f21..24f5db1401d 100644
--- a/myisam/mi_search.c
+++ b/myisam/mi_search.c
@@ -396,9 +396,18 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
matched=prefix_len+left;
- for (my_flag=0;left;left--)
- if ((my_flag= (int) sort_order[*vseg++] - (int) sort_order[*k++]))
- break;
+ if (sort_order)
+ {
+ for (my_flag=0;left;left--)
+ if ((my_flag= (int) sort_order[*vseg++] - (int) sort_order[*k++]))
+ break;
+ }
+ else
+ {
+ for (my_flag=0;left;left--)
+ if ((my_flag= (int) *vseg++ - (int) *k++))
+ break;
+ }
if (my_flag>0) /* mismatch */
break;