summaryrefslogtreecommitdiff
path: root/heap
diff options
context:
space:
mode:
authorunknown <svoj@april.(none)>2006-05-10 21:50:04 +0500
committerunknown <svoj@april.(none)>2006-05-10 21:50:04 +0500
commit2eeab0b0d8e561fec1451e7f763de4526236962b (patch)
tree3362204079a840355be45f5ceb63e91042aff484 /heap
parent8052fafd313d498362c1cb02d1efff889efea030 (diff)
downloadmariadb-git-2eeab0b0d8e561fec1451e7f763de4526236962b.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. heap/hp_create.c: Fixed key length for varchar fields to include number of bytes to store length. mysql-test/r/heap.result: Testcase for BUG#18233. mysql-test/t/heap.test: Testcase for BUG#18233.
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;
/*