diff options
author | unknown <monty@mysql.com> | 2005-06-07 15:09:49 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-06-07 15:09:49 +0300 |
commit | 3dba83b95a142e3b921ed3f8fef319651397aba5 (patch) | |
tree | 29a1f89760f03c27798ef5d933bc77fc7555cde8 /myisam | |
parent | 9f1610638b91853af778670da39e8e2d0a1a89c6 (diff) | |
download | mariadb-git-3dba83b95a142e3b921ed3f8fef319651397aba5.tar.gz |
Revert Bar's fix as this causes changes in the key tree that could cause incompatibilites
Fix instead wrong call to ha_key_cmp
This is related to bug #10741 Inserting double value into utf8 column crashes server
myisam/mi_key.c:
Revert Bar's fix as this causes changes in the key tree that could cause incompatibilites
myisam/mi_rnext_same.c:
Fixed wrong arguments to ha_key_cmp()
This caused a compare to fail if we first found a key with end space and then same key without end space
mysql-test/r/ctype_utf8.result:
Additional test
mysql-test/t/ctype_utf8.test:
Additional test
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/mi_key.c | 6 | ||||
-rw-r--r-- | myisam/mi_rnext_same.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/myisam/mi_key.c b/myisam/mi_key.c index 6a8d88f1117..9df22889b22 100644 --- a/myisam/mi_key.c +++ b/myisam/mi_key.c @@ -84,8 +84,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, pos= (byte*) record+keyseg->start; if (keyseg->flag & HA_SPACE_PACK) { - FIX_LENGTH(cs, pos, length, char_length); - end= pos + char_length; + end= pos + length; if (type != HA_KEYTYPE_NUM) { while (end > pos && end[-1] == ' ') @@ -96,7 +95,8 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, while (pos < end && pos[0] == ' ') pos++; } - char_length= (uint) (end - pos); + length=(uint) (end-pos); + FIX_LENGTH(cs, pos, length, char_length); store_key_length_inc(key,char_length); memcpy((byte*) key,(byte*) pos,(size_t) char_length); key+=char_length; diff --git a/myisam/mi_rnext_same.c b/myisam/mi_rnext_same.c index 06408f57a3f..4d770258a72 100644 --- a/myisam/mi_rnext_same.c +++ b/myisam/mi_rnext_same.c @@ -68,8 +68,8 @@ int mi_rnext_same(MI_INFO *info, byte *buf) info->lastkey_length,SEARCH_BIGGER, info->s->state.key_root[inx]))) break; - if (ha_key_cmp(keyinfo->seg,info->lastkey2,info->lastkey, - info->last_rkey_length, SEARCH_FIND, ¬_used)) + if (ha_key_cmp(keyinfo->seg, info->lastkey, info->lastkey2, + info->last_rkey_length, SEARCH_FIND, ¬_used)) { error=1; my_errno=HA_ERR_END_OF_FILE; |