~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_rlast.cc

  • Committer: lbieber
  • Date: 2010-09-10 05:19:01 UTC
  • mfrom: (1753.1.1 build)
  • Revision ID: lbieber@orisndriz03-20100910051901-lyq4bh4vdegvzyo4
Merge Brian - clean up Heap code

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
int heap_rlast(HP_INFO *info, unsigned char *record, int inx)
25
25
{
26
 
  HP_SHARE *share=    info->getShare();
27
 
  HP_KEYDEF *keyinfo= share->keydef + inx;
28
 
 
29
26
  info->lastinx= inx;
30
 
  if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
31
 
  {
32
 
    unsigned char *pos;
33
 
 
34
 
    if ((pos = (unsigned char *)tree_search_edge(&keyinfo->rb_tree,
35
 
                                                 info->parents,
36
 
                                                 &info->last_pos,
37
 
                                                 offsetof(TREE_ELEMENT, right))))
38
 
    {
39
 
      memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
40
 
             sizeof(unsigned char*));
41
 
      info->current_ptr = pos;
42
 
      hp_extract_record(share, record, pos);
43
 
      info->update = HA_STATE_AKTIV;
44
 
    }
45
 
    else
46
 
    {
47
 
      errno = HA_ERR_END_OF_FILE;
48
 
      return(errno);
49
 
    }
50
 
    return(0);
51
 
  }
52
 
  else
53
27
  {
54
28
    info->current_ptr=0;
55
29
    info->current_hash_ptr=0;