~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_rkey.cc

  • Committer: Brian Aker
  • Date: 2009-03-27 22:55:28 UTC
  • mto: This revision was merged to the branch mainline in revision 968.
  • Revision ID: brian@tangent.org-20090327225528-8y76cfx8a4oemqv9
Remove ref_count

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
#include "heapdef.h"
17
17
 
18
 
int heap_rkey(HP_INFO *info, unsigned char *record, int inx, const unsigned char *key, 
 
18
#include <string.h>
 
19
 
 
20
int heap_rkey(HP_INFO *info, unsigned char *record, int inx, const unsigned char *key,
19
21
              key_part_map keypart_map, enum ha_rkey_function find_flag)
20
22
{
21
23
  unsigned char *pos;
34
36
    heap_rb_param custom_arg;
35
37
 
36
38
    custom_arg.keyseg= info->s->keydef[inx].seg;
37
 
    custom_arg.key_length= info->lastkey_len= 
 
39
    custom_arg.key_length= info->lastkey_len=
38
40
      hp_rb_pack_key(keyinfo, (unsigned char*) info->lastkey,
39
41
                     (unsigned char*) key, keypart_map);
40
42
    custom_arg.search_flag= SEARCH_FIND | SEARCH_SAME;
45
47
      info->last_find_flag= HA_READ_KEY_OR_PREV;
46
48
    else
47
49
      info->last_find_flag= find_flag;
48
 
    if (!(pos= tree_search_key(&keyinfo->rb_tree, info->lastkey, info->parents,
49
 
                               &info->last_pos, find_flag, &custom_arg)))
 
50
    if (!(pos= (unsigned char *)tree_search_key(&keyinfo->rb_tree,
 
51
                                                info->lastkey, info->parents,
 
52
                                                &info->last_pos,
 
53
                                                find_flag, &custom_arg)))
50
54
    {
51
55
      info->update= 0;
52
56
      return(my_errno= HA_ERR_KEY_NOT_FOUND);