diff options
author | Igor Babaev <igor@askmonty.org> | 2011-01-05 15:03:30 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-01-05 15:03:30 -0800 |
commit | cb4fa7f401267bf887066100726c53f10b712e6d (patch) | |
tree | 94d37cef923e71c8ffd2f6feb6caaecf2991eb06 /sql/key.cc | |
parent | 77cbad4b31160aab28903c7852424c24dab3eec9 (diff) | |
download | mariadb-git-cb4fa7f401267bf887066100726c53f10b712e6d.tar.gz |
Fixed LP bug #697557.
When stored in a key buffer any varchar field has a length prefix
that always takes 2 bytes.
Diffstat (limited to 'sql/key.cc')
-rw-r--r-- | sql/key.cc | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/sql/key.cc b/sql/key.cc index 780cc6733c1..fd5c129eee8 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -689,20 +689,12 @@ ulong key_hashnr(KEY *key_info, uint used_key_parts, const uchar *key) pack_length= 0; break; case HA_KEYTYPE_VARTEXT1: - cs= key_part->field->charset(); - length= (uint)(pos[0]); - pack_length= 1; - break; - case HA_KEYTYPE_VARBINARY1: - cs= &my_charset_bin; - length= (uint)(pos[0]); - pack_length= 1; - break; case HA_KEYTYPE_VARTEXT2: cs= key_part->field->charset(); length= uint2korr(pos); pack_length= 2; break; + case HA_KEYTYPE_VARBINARY1: case HA_KEYTYPE_VARBINARY2: cs= &my_charset_bin; length= uint2korr(pos); @@ -806,23 +798,13 @@ bool key_buf_cmp(KEY *key_info, uint used_key_parts, pack_length= 0; break; case HA_KEYTYPE_VARTEXT1: - cs= key_part->field->charset(); - length1= (uint)(pos1[0]); - length2= (uint)(pos2[0]); - pack_length= 1; - break; - case HA_KEYTYPE_VARBINARY1: - cs= &my_charset_bin; - length1= (uint)(pos1[0]); - length2= (uint)(pos2[0]); - pack_length= 1; - break; case HA_KEYTYPE_VARTEXT2: cs= key_part->field->charset(); length1= uint2korr(pos1); length2= uint2korr(pos2); pack_length= 2; break; + case HA_KEYTYPE_VARBINARY1: case HA_KEYTYPE_VARBINARY2: cs= &my_charset_bin; length1= uint2korr(pos1); |