~jaypipes/drizzle/subscriber-plugin

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_statrec.cc

Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    if (info->state->data_file_length > info->s->base.max_data_file_length-
43
43
        info->s->base.pack_reclength)
44
44
    {
45
 
      my_errno=HA_ERR_RECORD_FILE_FULL;
 
45
      errno=HA_ERR_RECORD_FILE_FULL;
46
46
      return(2);
47
47
    }
48
48
    if (info->opt_flag & WRITE_CACHE_USED)
130
130
    if (memcmp(info->rec_buff, old,
131
131
               (uint) info->s->base.reclength))
132
132
    {
133
 
      my_errno=HA_ERR_RECORD_CHANGED;           /* Record have changed */
 
133
      errno=HA_ERR_RECORD_CHANGED;              /* Record have changed */
134
134
      return(1);
135
135
    }
136
136
  }
175
175
    {
176
176
      if (!*record)
177
177
      {
178
 
        my_errno=HA_ERR_RECORD_DELETED;
 
178
        errno=HA_ERR_RECORD_DELETED;
179
179
        return(1);                              /* Record is deleted */
180
180
      }
181
181
      info->update|= HA_STATE_AKTIV;            /* Record is read */
202
202
  if (info->opt_flag & WRITE_CACHE_USED &&
203
203
      (info->rec_cache.pos_in_file <= filepos || skip_deleted_blocks) &&
204
204
      flush_io_cache(&info->rec_cache))
205
 
    return(my_errno);
 
205
    return(errno);
206
206
  if (info->opt_flag & READ_CACHE_USED)
207
207
  {                                             /* Cache in use */
208
208
    if (filepos == my_b_tell(&info->rec_cache) &&
220
220
    if (filepos >= info->state->data_file_length)
221
221
    {                                           /* Test if new records */
222
222
      if (_mi_readinfo(info,F_RDLCK,0))
223
 
        return(my_errno);
 
223
        return(errno);
224
224
      locked=1;
225
225
    }
226
226
    else
235
235
  if (filepos >= info->state->data_file_length)
236
236
  {
237
237
    fast_mi_writeinfo(info);
238
 
    return(my_errno=HA_ERR_END_OF_FILE);
 
238
    return(errno=HA_ERR_END_OF_FILE);
239
239
  }
240
240
  info->lastpos= filepos;
241
241
  info->nextpos= filepos+share->base.pack_reclength;
245
245
    if ((error=_mi_read_static_record(info,filepos,buf)))
246
246
    {
247
247
      if (error > 0)
248
 
        error=my_errno=HA_ERR_RECORD_DELETED;
 
248
        error=errno=HA_ERR_RECORD_DELETED;
249
249
      else
250
 
        error=my_errno;
 
250
        error=errno;
251
251
    }
252
252
    return(error);
253
253
  }
266
266
  {
267
267
    if (!buf[0])
268
268
    {                                           /* Record is removed */
269
 
      return(my_errno=HA_ERR_RECORD_DELETED);
 
269
      return(errno=HA_ERR_RECORD_DELETED);
270
270
    }
271
271
                                                /* Found and may be updated */
272
272
    info->update|= HA_STATE_AKTIV | HA_STATE_KEY_CHANGED;
273
273
    return(0);
274
274
  }
275
 
  /* my_errno should be set if rec_cache.error == -1 */
276
 
  if (info->rec_cache.error != -1 || my_errno == 0)
277
 
    my_errno=HA_ERR_WRONG_IN_RECORD;
278
 
  return(my_errno);                     /* Something wrong (EOF?) */
 
275
  /* errno should be set if rec_cache.error == -1 */
 
276
  if (info->rec_cache.error != -1 || errno == 0)
 
277
    errno=HA_ERR_WRONG_IN_RECORD;
 
278
  return(errno);                        /* Something wrong (EOF?) */
279
279
}