~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_rnext.c

  • Committer: Monty Taylor
  • Date: 2008-08-01 22:33:44 UTC
  • mto: (236.1.42 codestyle)
  • mto: This revision was merged to the branch mainline in revision 261.
  • Revision ID: monty@inaugust.com-20080801223344-vzhlflfmtijp1imv
First pass at gettexizing the error messages.

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 "myisam_priv.h"
 
16
#include "myisamdef.h"
17
17
 
18
18
        /*
19
19
           Read next row with the same key as previous read
22
22
           based on the position of the last used key!
23
23
        */
24
24
 
25
 
int mi_rnext(MI_INFO *info, unsigned char *buf, int inx)
 
25
int mi_rnext(MI_INFO *info, uchar *buf, int inx)
26
26
{
27
27
  int error,changed;
28
 
  uint32_t flag;
 
28
  uint flag;
29
29
  int res= 0;
30
30
 
31
31
  if ((inx = _mi_check_index(info,inx)) < 0)
32
 
    return(errno);
 
32
    return(my_errno);
33
33
  flag=SEARCH_BIGGER;                           /* Read next */
34
34
  if (info->lastpos == HA_OFFSET_ERROR && info->update & HA_STATE_PREV_FOUND)
35
35
    flag=0;                                     /* Read first */
36
36
 
37
37
  if (fast_mi_readinfo(info))
38
 
    return(errno);
 
38
    return(my_errno);
39
39
  if (info->s->concurrent_insert)
40
 
    pthread_rwlock_rdlock(&info->s->key_root_lock[inx]);
 
40
    rw_rdlock(&info->s->key_root_lock[inx]);
41
41
  changed=_mi_test_if_changed(info);
42
42
  if (!flag)
43
43
  {
82
82
    if (!error && res == 2)
83
83
    {
84
84
      if (info->s->concurrent_insert)
85
 
        pthread_rwlock_unlock(&info->s->key_root_lock[inx]);
 
85
        rw_unlock(&info->s->key_root_lock[inx]);
86
86
      info->lastpos= HA_OFFSET_ERROR;
87
 
      return(errno= HA_ERR_END_OF_FILE);
 
87
      return(my_errno= HA_ERR_END_OF_FILE);
88
88
    }
89
89
  }
90
 
 
 
90
  
91
91
  if (info->s->concurrent_insert)
92
 
    pthread_rwlock_unlock(&info->s->key_root_lock[inx]);
 
92
    rw_unlock(&info->s->key_root_lock[inx]);
93
93
 
94
94
        /* Don't clear if database-changed */
95
95
  info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
97
97
 
98
98
  if (error)
99
99
  {
100
 
    if (errno == HA_ERR_KEY_NOT_FOUND)
101
 
      errno=HA_ERR_END_OF_FILE;
 
100
    if (my_errno == HA_ERR_KEY_NOT_FOUND)
 
101
      my_errno=HA_ERR_END_OF_FILE;
102
102
  }
103
103
  else if (!buf)
104
104
  {
105
 
    return(info->lastpos==HA_OFFSET_ERROR ? errno : 0);
 
105
    return(info->lastpos==HA_OFFSET_ERROR ? my_errno : 0);
106
106
  }
107
107
  else if (!(*info->read_record)(info,info->lastpos,buf))
108
108
  {
109
109
    info->update|= HA_STATE_AKTIV;              /* Record is read */
110
110
    return(0);
111
111
  }
112
 
  return(errno);
 
112
  return(my_errno);
113
113
} /* mi_rnext */