~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_rfirst.cc

  • Committer: Brian Aker
  • Date: 2010-01-27 18:58:12 UTC
  • Revision ID: brian@gaz-20100127185812-n62n0vwetnx8jrjy
Remove dead code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
#include "heapdef.h"
 
16
#include "heap_priv.h"
 
17
 
 
18
#include <string.h>
 
19
#include <cassert>
17
20
 
18
21
/* Read first record with the current key */
19
22
 
20
 
int heap_rfirst(HP_INFO *info, uchar *record, int inx)
 
23
int heap_rfirst(HP_INFO *info, unsigned char *record, int inx)
21
24
{
22
25
  HP_SHARE *share = info->s;
23
26
  HP_KEYDEF *keyinfo = share->keydef + inx;
24
 
  
 
27
 
25
28
  info->lastinx= inx;
26
29
  if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
27
30
  {
28
 
    uchar *pos;
 
31
    unsigned char *pos;
29
32
 
30
 
    if ((pos = tree_search_edge(&keyinfo->rb_tree, info->parents,
31
 
                                &info->last_pos, offsetof(TREE_ELEMENT, left))))
 
33
    if ((pos = (unsigned char *)tree_search_edge(&keyinfo->rb_tree,
 
34
                                                 info->parents,
 
35
                                                 &info->last_pos,
 
36
                                                 offsetof(TREE_ELEMENT, left))))
32
37
    {
33
 
      memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos), 
34
 
             sizeof(uchar*));
 
38
      memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
 
39
             sizeof(unsigned char*));
35
40
      info->current_ptr = pos;
36
41
      hp_extract_record(share, record, pos);
37
42
      /*
49
54
    }
50
55
    else
51
56
    {
52
 
      my_errno = HA_ERR_END_OF_FILE;
53
 
      return(my_errno);
 
57
      errno = HA_ERR_END_OF_FILE;
 
58
      return(errno);
54
59
    }
55
60
    return(0);
56
61
  }
58
63
  {
59
64
    if (!(info->s->records))
60
65
    {
61
 
      my_errno=HA_ERR_END_OF_FILE;
62
 
      return(my_errno);
 
66
      errno=HA_ERR_END_OF_FILE;
 
67
      return(errno);
63
68
    }
64
69
    assert(0); /* TODO fix it */
65
70
    info->current_record=0;