~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_statrec.cc

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    }
50
50
    if (info->opt_flag & WRITE_CACHE_USED)
51
51
    {                           /* Cash in use */
52
 
      if (my_b_write(&info->rec_cache, record,
53
 
                     info->s->base.reclength))
 
52
      if (info->rec_cache.write(record, info->s->base.reclength))
54
53
        goto err;
55
54
      if (info->s->base.pack_reclength != info->s->base.reclength)
56
55
      {
57
56
        uint32_t length=info->s->base.pack_reclength - info->s->base.reclength;
58
57
        memset(temp, 0, length);
59
 
        if (my_b_write(&info->rec_cache, temp,length))
 
58
        if (info->rec_cache.write(temp,length))
60
59
          goto err;
61
60
      }
62
61
    }
115
114
{
116
115
  if (info->opt_flag & WRITE_CACHE_USED)
117
116
  {
118
 
    if (flush_io_cache(&info->rec_cache))
 
117
    if (info->rec_cache.flush())
119
118
    {
120
119
      return(-1);
121
120
    }
160
159
int _mi_read_static_record(register MI_INFO *info, register internal::my_off_t pos,
161
160
                           register unsigned char *record)
162
161
{
163
 
  int error;
164
 
 
165
162
  if (pos != HA_OFFSET_ERROR)
166
163
  {
167
164
    if (info->opt_flag & WRITE_CACHE_USED &&
168
165
        info->rec_cache.pos_in_file <= pos &&
169
 
        flush_io_cache(&info->rec_cache))
 
166
        info->rec_cache.flush())
170
167
      return(-1);
171
168
    info->rec_cache.seek_not_done=1;            /* We have done a seek */
172
169
 
173
 
    error=info->s->file_read(info, record, info->s->base.reclength,
174
 
                   pos,MYF(MY_NABP)) != 0;
 
170
    int error= info->s->file_read(info, record, info->s->base.reclength, pos,MYF(MY_NABP)) != 0;
175
171
    fast_mi_writeinfo(info);
176
172
    if (! error)
177
173
    {
196
192
                               bool skip_deleted_blocks)
197
193
{
198
194
  int locked,error,cache_read;
199
 
  uint32_t cache_length;
200
195
  MYISAM_SHARE *share=info->s;
201
196
 
202
197
  cache_read=0;
203
 
  cache_length=0;
204
198
  if (info->opt_flag & WRITE_CACHE_USED &&
205
199
      (info->rec_cache.pos_in_file <= filepos || skip_deleted_blocks) &&
206
 
      flush_io_cache(&info->rec_cache))
 
200
      info->rec_cache.flush())
207
201
    return(errno);
208
202
  if (info->opt_flag & READ_CACHE_USED)
209
203
  {                                             /* Cache in use */
210
 
    if (filepos == my_b_tell(&info->rec_cache) &&
 
204
    if (filepos == info->rec_cache.tell() &&
211
205
        (skip_deleted_blocks || !filepos))
212
206
    {
213
207
      cache_read=1;                             /* Read record using cache */
214
 
      cache_length=(uint) (info->rec_cache.read_end - info->rec_cache.read_pos);
215
208
    }
216
209
    else
217
210
      info->rec_cache.seek_not_done=1;          /* Filepos is changed */
255
248
  }
256
249
 
257
250
        /* Read record with cacheing */
258
 
  error=my_b_read(&info->rec_cache,(unsigned char*) buf,share->base.reclength);
 
251
  error= info->rec_cache.read(buf, share->base.reclength);
259
252
  if (info->s->base.pack_reclength != info->s->base.reclength && !error)
260
253
  {
261
254
    char tmp[8];                                /* Skill fill bytes */
262
 
    error=my_b_read(&info->rec_cache,(unsigned char*) tmp,
263
 
                    info->s->base.pack_reclength - info->s->base.reclength);
 
255
    error= info->rec_cache.read(tmp, info->s->base.pack_reclength - info->s->base.reclength);
264
256
  }
265
257
  if (locked)
266
258
    _mi_writeinfo(info,0);              /* Unlock keyfile */