~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_rprev.c

  • Committer: Monty Taylor
  • Date: 2008-07-05 22:08:52 UTC
  • mto: This revision was merged to the branch mainline in revision 77.
  • Revision ID: monty@inaugust.com-20080705220852-cqd9t6tfkhvlcf73
Removed HAVE_LONG_LONG, as this is now assumed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
           based on the position of the last used key!
23
23
        */
24
24
 
25
 
int mi_rprev(MI_INFO *info, unsigned char *buf, int inx)
 
25
int mi_rprev(MI_INFO *info, uchar *buf, int inx)
26
26
{
27
27
  int error,changed;
28
 
  register uint32_t flag;
 
28
  register uint flag;
29
29
  MYISAM_SHARE *share=info->s;
 
30
  DBUG_ENTER("mi_rprev");
30
31
 
31
32
  if ((inx = _mi_check_index(info,inx)) < 0)
32
 
    return(my_errno);
 
33
    DBUG_RETURN(my_errno);
33
34
  flag=SEARCH_SMALLER;                          /* Read previous */
34
35
  if (info->lastpos == HA_OFFSET_ERROR && info->update & HA_STATE_NEXT_FOUND)
35
36
    flag=0;                                     /* Read last */
36
37
 
37
38
  if (fast_mi_readinfo(info))
38
 
    return(my_errno);
 
39
    DBUG_RETURN(my_errno);
39
40
  changed=_mi_test_if_changed(info);
40
41
  if (share->concurrent_insert)
41
42
    rw_rdlock(&share->key_root_lock[inx]);
75
76
  }
76
77
  else if (!buf)
77
78
  {
78
 
    return(info->lastpos==HA_OFFSET_ERROR ? my_errno : 0);
 
79
    DBUG_RETURN(info->lastpos==HA_OFFSET_ERROR ? my_errno : 0);
79
80
  }
80
81
  else if (!(*info->read_record)(info,info->lastpos,buf))
81
82
  {
82
83
    info->update|= HA_STATE_AKTIV;              /* Record is read */
83
 
    return(0);
 
84
    DBUG_RETURN(0);
84
85
  }
85
 
  return(my_errno);
 
86
  DBUG_RETURN(my_errno);
86
87
} /* mi_rprev */