summaryrefslogtreecommitdiff
path: root/heap
diff options
context:
space:
mode:
authorsvoj@april.(none) <>2006-05-10 21:50:04 +0500
committersvoj@april.(none) <>2006-05-10 21:50:04 +0500
commitae67994fe6ddb66d32605f26cd1df3febd1217de (patch)
tree3362204079a840355be45f5ceb63e91042aff484 /heap
parent3ad0cac41b3239940221f6e886b200d5f8b06eca (diff)
downloadmariadb-git-ae67994fe6ddb66d32605f26cd1df3febd1217de.tar.gz
BUG#18233 - Memory tables INDEX USING HASH (a,b) returns 1 row on
SELECT WHERE a= AND b= Selecting data from memory table with varchar column and hash index over it returns only first row matched. Problem was that key length calculation for varchar columns didn't include number of bytes to store length. Fixed key length for varchar fields to include number of bytes to store length.
Diffstat (limited to 'heap')
-rw-r--r--heap/hp_create.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/heap/hp_create.c b/heap/hp_create.c
index 9ffa4e33108..eb7a068c78b 100644
--- a/heap/hp_create.c
+++ b/heap/hp_create.c
@@ -85,6 +85,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
if (!my_binary_compare(keyinfo->seg[j].charset))
keyinfo->flag|= HA_END_SPACE_KEY;
keyinfo->flag|= HA_VAR_LENGTH_KEY;
+ length+= 2;
/* Save number of bytes used to store length */
keyinfo->seg[j].bit_start= 1;
break;
@@ -95,6 +96,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
if (!my_binary_compare(keyinfo->seg[j].charset))
keyinfo->flag|= HA_END_SPACE_KEY;
keyinfo->flag|= HA_VAR_LENGTH_KEY;
+ length+= 2;
/* Save number of bytes used to store length */
keyinfo->seg[j].bit_start= 2;
/*