summaryrefslogtreecommitdiff
path: root/heap
diff options
context:
space:
mode:
Diffstat (limited to 'heap')
-rw-r--r--heap/hp_hash.c13
-rw-r--r--heap/hp_rfirst.c5
2 files changed, 14 insertions, 4 deletions
diff --git a/heap/hp_hash.c b/heap/hp_hash.c
index e29e51d2b75..519779d330d 100644
--- a/heap/hp_hash.c
+++ b/heap/hp_hash.c
@@ -173,7 +173,7 @@ ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
for (; pos < (uchar*) key ; pos++)
{
nr^=(ulong) ((((uint) nr & 63)+nr2) *
- ((uint) my_sort_order[(uint) *pos])) + (nr << 8);
+ ((uint) default_charset_info->sort_order[(uint) *pos])) + (nr << 8);
nr2+=3;
}
}
@@ -212,7 +212,7 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
for (; pos < end ; pos++)
{
nr^=(ulong) ((((uint) nr & 63)+nr2)*
- ((uint) my_sort_order[(uint) *pos]))+ (nr << 8);
+ ((uint) default_charset_info->sort_order[(uint) *pos]))+ (nr << 8);
nr2+=3;
}
}
@@ -343,7 +343,7 @@ int _hp_rec_key_cmp(HP_KEYDEF *keydef, const byte *rec1, const byte *rec2)
}
if (seg->type == HA_KEYTYPE_TEXT)
{
- if (my_sortcmp(rec1+seg->start,rec2+seg->start,seg->length))
+ if (my_sortcmp(default_charset_info,rec1+seg->start,rec2+seg->start,seg->length))
return 1;
}
else
@@ -375,7 +375,12 @@ int _hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key)
}
if (seg->type == HA_KEYTYPE_TEXT)
{
- if (my_sortcmp(rec+seg->start,key,seg->length))
+ /*
+ BAR TODO: this will not use default_charset_info
+ I need Ram to apply his HEAP patches with
+ CHARSET_INFO field in HP segments
+ */
+ if (my_sortcmp(default_charset_info,rec+seg->start,key,seg->length))
return 1;
}
else
diff --git a/heap/hp_rfirst.c b/heap/hp_rfirst.c
index 9a1f09244a0..b20918ff3a7 100644
--- a/heap/hp_rfirst.c
+++ b/heap/hp_rfirst.c
@@ -21,6 +21,11 @@
int heap_rfirst(HP_INFO *info, byte *record)
{
DBUG_ENTER("heap_rfirst");
+ if (!(info->s->records))
+ {
+ my_errno=HA_ERR_END_OF_FILE;
+ DBUG_RETURN(my_errno);
+ }
info->current_record=0;
info->current_hash_ptr=0;
info->update=HA_STATE_PREV_FOUND;