~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_rnext.c

  • Committer: Monty Taylor
  • Date: 2008-07-01 14:33:36 UTC
  • mto: (28.1.12 backport_patch)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: monty@inaugust.com-20080701143336-8uihm7dhpu92rt0q
Somehow missed moving password.c. Duh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
/* Read next record with the same key */
19
19
 
20
 
int heap_rnext(HP_INFO *info, unsigned char *record)
 
20
int heap_rnext(HP_INFO *info, uchar *record)
21
21
{
22
 
  unsigned char *pos;
 
22
  uchar *pos;
23
23
  HP_SHARE *share=info->s;
24
24
  HP_KEYDEF *keyinfo;
 
25
  DBUG_ENTER("heap_rnext");
25
26
  
26
27
  if (info->lastinx < 0)
27
 
    return(my_errno=HA_ERR_WRONG_INDEX);
 
28
    DBUG_RETURN(my_errno=HA_ERR_WRONG_INDEX);
28
29
 
29
30
  keyinfo = share->keydef + info->lastinx;
30
31
  if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
75
76
    if (pos)
76
77
    {
77
78
      memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos), 
78
 
             sizeof(unsigned char*));
 
79
             sizeof(uchar*));
79
80
      info->current_ptr = pos;
80
81
    }
81
82
    else
106
107
    info->update=HA_STATE_NEXT_FOUND;           /* For heap_rprev */
107
108
    if (my_errno == HA_ERR_KEY_NOT_FOUND)
108
109
      my_errno=HA_ERR_END_OF_FILE;
109
 
    return(my_errno);
 
110
    DBUG_RETURN(my_errno);
110
111
  }
111
 
  hp_extract_record(share, record, pos);
 
112
  memcpy(record,pos,(size_t) share->reclength);
112
113
  info->update=HA_STATE_AKTIV | HA_STATE_NEXT_FOUND;
113
 
  return(0);
 
114
  DBUG_RETURN(0);
114
115
}