~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/mf_iocache.cc

  • Committer: Olaf van der Spek
  • Date: 2011-08-13 18:31:31 UTC
  • mto: This revision was merged to the branch mainline in revision 2407.
  • Revision ID: olafvdspek@gmail.com-20110813183131-tvp5kxqo9l4z82eo
Refactor iocache

Show diffs side-by-side

added added

removed removed

Lines of Context:
289
289
  /* If the whole file is in memory, avoid flushing to disk */
290
290
  if (! clear_cache &&
291
291
      seek_offset >= pos_in_file &&
292
 
      seek_offset <= my_b_tell(this))
 
292
      seek_offset <= tell())
293
293
  {
294
294
    /* Reuse current buffer without flushing it to disk */
295
295
    unsigned char *pos;
296
296
    if (type == WRITE_CACHE && type_arg == READ_CACHE)
297
297
    {
298
298
      read_end=write_pos;
299
 
      end_of_file=my_b_tell(this);
 
299
      end_of_file= tell();
300
300
      /*
301
301
        Trigger a new seek only if we have a valid
302
302
        file handle.
325
325
      after the current positions should be ignored
326
326
    */
327
327
    if (type == WRITE_CACHE && type_arg == READ_CACHE)
328
 
      end_of_file=my_b_tell(this);
 
328
      end_of_file= tell();
329
329
    /* flush cache if we want to reuse it */
330
330
    if (!clear_cache && flush(1))
331
331
      return 1;