~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_rlast.c

Removed/replaced DBUG symbols and standardized TRUE/FALSE

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
        /* Read first record with the current key */
19
19
 
20
20
 
21
 
int heap_rlast(HP_INFO *info, unsigned char *record, int inx)
 
21
int heap_rlast(HP_INFO *info, uchar *record, int inx)
22
22
{
23
23
  HP_SHARE *share=    info->s;
24
24
  HP_KEYDEF *keyinfo= share->keydef + inx;
25
25
 
 
26
  DBUG_ENTER("heap_rlast");
26
27
  info->lastinx= inx;
27
28
  if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
28
29
  {
29
 
    unsigned char *pos;
 
30
    uchar *pos;
30
31
 
31
32
    if ((pos = tree_search_edge(&keyinfo->rb_tree, info->parents,
32
33
                                &info->last_pos, offsetof(TREE_ELEMENT, right))))
33
34
    {
34
35
      memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos), 
35
 
             sizeof(unsigned char*));
 
36
             sizeof(uchar*));
36
37
      info->current_ptr = pos;
37
 
      hp_extract_record(share, record, pos);
 
38
      memcpy(record, pos, (size_t)share->reclength);
38
39
      info->update = HA_STATE_AKTIV;
39
40
    }
40
41
    else
41
42
    {
42
43
      my_errno = HA_ERR_END_OF_FILE;
43
 
      return(my_errno);
 
44
      DBUG_RETURN(my_errno);
44
45
    }
45
 
    return(0);
 
46
    DBUG_RETURN(0);
46
47
  }
47
48
  else
48
49
  {
49
50
    info->current_ptr=0;
50
51
    info->current_hash_ptr=0;
51
52
    info->update=HA_STATE_NEXT_FOUND;
52
 
    return(heap_rprev(info,record));
 
53
    DBUG_RETURN(heap_rprev(info,record));
53
54
  }
54
55
}