summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2005-06-07 13:56:42 +0500
committerunknown <bar@mysql.com>2005-06-07 13:56:42 +0500
commitc9914ac6ac456386aff36f948fa8036f066612bf (patch)
treeddfae8863835948b6506f22aef6d459ca2a0178d /myisam
parente3dc3db659a5d8edec4d46635d069d0c1777bb8c (diff)
downloadmariadb-git-c9914ac6ac456386aff36f948fa8036f066612bf.tar.gz
Bug#10253: compound index length and utf8 char set
produces invalid query results mi_key.c: well_formed_length should be executed before space trimming, not after. ctype_utf8.test: ctype_utf8.result: adding test. myisam/mi_key.c: Bug#10253: ompound index length and utf8 char set produces invalid query results well_formed_length should be executed before space trimming, not after. mysql-test/r/ctype_utf8.result: adding test. adding test. mysql-test/t/ctype_utf8.test: adding test.
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_key.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/myisam/mi_key.c b/myisam/mi_key.c
index b7240f34538..6a8d88f1117 100644
--- a/myisam/mi_key.c
+++ b/myisam/mi_key.c
@@ -84,7 +84,8 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
pos= (byte*) record+keyseg->start;
if (keyseg->flag & HA_SPACE_PACK)
{
- end=pos+length;
+ FIX_LENGTH(cs, pos, length, char_length);
+ end= pos + char_length;
if (type != HA_KEYTYPE_NUM)
{
while (end > pos && end[-1] == ' ')
@@ -95,8 +96,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
while (pos < end && pos[0] == ' ')
pos++;
}
- length=(uint) (end-pos);
- FIX_LENGTH(cs, pos, length, char_length);
+ char_length= (uint) (end - pos);
store_key_length_inc(key,char_length);
memcpy((byte*) key,(byte*) pos,(size_t) char_length);
key+=char_length;