summaryrefslogtreecommitdiff
path: root/heap
diff options
context:
space:
mode:
Diffstat (limited to 'heap')
-rw-r--r--heap/hp_hash.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/heap/hp_hash.c b/heap/hp_hash.c
index d8eee9c794c..251be1a3fe2 100644
--- a/heap/hp_hash.c
+++ b/heap/hp_hash.c
@@ -808,6 +808,12 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
if (!(*key++= (char) 1 - *old++))
{
k_len-= seg->length;
+ /*
+ Take into account length (2 bytes) of varchar key parts
+ stored before the data.
+ */
+ if (seg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART))
+ k_len-= 2;
continue;
}
}