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/myisam/mi_rkey.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/myisam/mi_rkey.c')
-rw-r--r-- | storage/myisam/mi_rkey.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/storage/myisam/mi_rkey.c b/storage/myisam/mi_rkey.c index 6323c95ffd7..027d3d8dea0 100644 --- a/storage/myisam/mi_rkey.c +++ b/storage/myisam/mi_rkey.c @@ -21,8 +21,8 @@ /* Read a record using key */ /* Ordinary search_flag is 0 ; Give error if no record with key */ -int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, - enum ha_rkey_function search_flag) +int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, + ulonglong keypart_map, enum ha_rkey_function search_flag) { uchar *key_buff; MYISAM_SHARE *share=info->s; @@ -30,8 +30,8 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, HA_KEYSEG *last_used_keyseg; uint pack_key_length, use_key_length, nextflag; DBUG_ENTER("mi_rkey"); - DBUG_PRINT("enter", ("base: %lx buf: %lx inx: %d search_flag: %d", - (long) info, (long) buf, inx, search_flag)); + DBUG_PRINT("enter", ("base: %lx buf: %lx inx: %d keyparts %lx search_flag: %d", + (long) info, (long) buf, inx, keypart_map, search_flag)); if ((inx = _mi_check_index(info,inx)) < 0) DBUG_RETURN(my_errno); @@ -47,18 +47,17 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, key is already packed!; This happens when we are using a MERGE TABLE */ key_buff=info->lastkey+info->s->base.max_key_length; - pack_key_length= key_len; - bmove(key_buff,key,key_len); + pack_key_length= keypart_map; + bmove(key_buff, key, pack_key_length); last_used_keyseg= 0; } else { - if (key_len == 0) - key_len=USE_WHOLE_KEY; + DBUG_ASSERT(keypart_map); /* Save the packed key for later use in the second buffer of lastkey. */ key_buff=info->lastkey+info->s->base.max_key_length; pack_key_length=_mi_pack_key(info,(uint) inx, key_buff, (uchar*) key, - key_len, &last_used_keyseg); + keypart_map, &last_used_keyseg); /* Save packed_key_length for use by the MERGE engine. */ info->pack_key_length= pack_key_length; DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE, keyinfo->seg, |