~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_rprev.cc

Remove dead memset call.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
int heap_rprev(HP_INFO *info, unsigned char *record)
26
26
{
27
27
  unsigned char *pos;
28
 
  HP_SHARE *share=info->s;
 
28
  HP_SHARE *share=info->getShare();
29
29
  HP_KEYDEF *keyinfo;
30
30
 
31
31
  if (info->lastinx < 0)
32
32
    return(errno=HA_ERR_WRONG_INDEX);
33
33
  keyinfo = share->keydef + info->lastinx;
34
 
  if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
35
 
  {
36
 
    heap_rb_param custom_arg;
37
 
 
38
 
    if (info->last_pos)
39
 
      pos = (unsigned char *)tree_search_next(&keyinfo->rb_tree,
40
 
                                              &info->last_pos,
41
 
                                              offsetof(TREE_ELEMENT, right),
42
 
                                              offsetof(TREE_ELEMENT, left));
43
 
    else
44
 
    {
45
 
      custom_arg.keyseg = keyinfo->seg;
46
 
      custom_arg.key_length = keyinfo->length;
47
 
      custom_arg.search_flag = SEARCH_SAME;
48
 
      pos = (unsigned char *)tree_search_key(&keyinfo->rb_tree,
49
 
                                             info->lastkey, info->parents,
50
 
                                             &info->last_pos,
51
 
                                             info->last_find_flag,
52
 
                                             &custom_arg);
53
 
    }
54
 
    if (pos)
55
 
    {
56
 
      memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
57
 
             sizeof(unsigned char*));
58
 
      info->current_ptr = pos;
59
 
    }
60
 
    else
61
 
    {
62
 
      errno = HA_ERR_KEY_NOT_FOUND;
63
 
    }
64
 
  }
65
 
  else
66
34
  {
67
35
    if (info->current_ptr || (info->update & HA_STATE_NEXT_FOUND))
68
36
    {
69
37
      if ((info->update & HA_STATE_DELETED))
70
 
        pos= hp_search(info, share->keydef + info->lastinx, info->lastkey, 3);
 
38
        pos= hp_search(info, share->keydef + info->lastinx, &info->lastkey[0], 3);
71
39
      else
72
 
        pos= hp_search(info, share->keydef + info->lastinx, info->lastkey, 2);
 
40
        pos= hp_search(info, share->keydef + info->lastinx, &info->lastkey[0], 2);
73
41
    }
74
42
    else
75
43
    {