diff options
author | unknown <serg@janus.mylan> | 2007-01-29 10:40:26 +0100 |
---|---|---|
committer | unknown <serg@janus.mylan> | 2007-01-29 10:40:26 +0100 |
commit | 4e8b49d656828fbe2f84d9970a036db644185981 (patch) | |
tree | f14bd08181ddd81d2a41f06d9bf0f11d6edf53b5 /storage/heap/hp_hash.c | |
parent | 6e1ba88418887369ca71b49222c6fd66335bbe0c (diff) | |
download | mariadb-git-4e8b49d656828fbe2f84d9970a036db644185981.tar.gz |
WL#3700: Handler API change: all index search methods - that is,
index_read(), index_read_idx(), index_read_last(), and
records_in_range() - instead of 'uint keylen' argument take
'ulonglong keypart_map', a bitmap showing which keyparts are
present in the key value.
Fallback method is provided for handlers that are lagging behind.
Diffstat (limited to 'storage/heap/hp_hash.c')
-rw-r--r-- | storage/heap/hp_hash.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/storage/heap/hp_hash.c b/storage/heap/hp_hash.c index c5a30a3ef65..326f6adea45 100644 --- a/storage/heap/hp_hash.c +++ b/storage/heap/hp_hash.c @@ -784,30 +784,26 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key, uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, - uint k_len) + ulonglong keypart_map) { HA_KEYSEG *seg, *endseg; uchar *start_key= key; for (seg= keydef->seg, endseg= seg + keydef->keysegs; - seg < endseg && (int) k_len > 0; old+= seg->length, seg++) + seg < endseg && keypart_map; old+= seg->length, seg++) { uint char_length; + keypart_map>>= 1; if (seg->null_bit) { - k_len--; if (!(*key++= (char) 1 - *old++)) - { - k_len-= seg->length; continue; } - } if (seg->flag & HA_SWAP_KEY) { uint length= seg->length; byte *pos= (byte*) old + length; - k_len-= length; while (length--) { *key++= *--pos; @@ -822,7 +818,6 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, CHARSET_INFO *cs= seg->charset; char_length= length/cs->mbmaxlen; - k_len-= 2+length; old+= 2; set_if_smaller(length,tmp_length); /* Safety */ FIX_LENGTH(cs, old, length, char_length); @@ -843,7 +838,6 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, } memcpy(key, old, (size_t) char_length); key+= seg->length; - k_len-= seg->length; } return (uint) (key - start_key); } |