~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/filesort.cc

  • Committer: Olaf van der Spek
  • Date: 2011-08-13 16:39:27 UTC
  • mto: This revision was merged to the branch mainline in revision 2407.
  • Revision ID: olafvdspek@gmail.com-20110813163927-luksv0xydcqmi5pz
Refactor iocache

Show diffs side-by-side

added added

removed removed

Lines of Context:
359
359
    table_sort.buffpek_len= maxbuffer;
360
360
    buffpek_pointers.close_cached_file();
361
361
        /* Open cached file if it isn't open */
362
 
    if (! my_b_inited(outfile) && outfile->open_cached_file(drizzle_tmpdir.c_str(),TEMP_PREFIX,READ_RECORD_BUFFER, MYF(MY_WME)))
 
362
    if (not outfile->inited() && outfile->open_cached_file(drizzle_tmpdir.c_str(),TEMP_PREFIX,READ_RECORD_BUFFER, MYF(MY_WME)))
363
363
    {
364
364
      goto err;
365
365
    }
411
411
  tempfile.close_cached_file();
412
412
  buffpek_pointers.close_cached_file();
413
413
 
414
 
  if (my_b_inited(outfile))
 
414
  if (outfile->inited())
415
415
  {
416
416
    if (outfile->flush())
417
417
    {
418
 
      error=1;
 
418
      error= 1;
419
419
    }
420
420
    {
421
421
      internal::my_off_t save_pos= outfile->pos_in_file;
422
422
      /* For following reads */
423
423
      if (outfile->reinit_io_cache(internal::READ_CACHE,0L,0,0))
424
424
      {
425
 
        error=1;
 
425
        error=1;
426
426
      }
427
427
      outfile->end_of_file=save_pos;
428
428
    }
681
681
    return(HA_POS_ERROR);
682
682
  }
683
683
 
684
 
  return(my_b_inited(tempfile) ?
685
 
              (ha_rows) (my_b_tell(tempfile)/param->rec_length) :
686
 
              idx);
 
684
  return tempfile->inited() ? (ha_rows) (my_b_tell(tempfile)/param->rec_length) : idx;
687
685
} /* find_all_keys */
688
686
 
689
687
 
715
713
  buffpek buffpek;
716
714
 
717
715
  internal::my_string_ptr_sort((unsigned char*) sort_keys, (uint32_t) count, sort_length);
718
 
  if (!my_b_inited(tempfile) &&
 
716
  if (not tempfile->inited() &&
719
717
      tempfile->open_cached_file(drizzle_tmpdir.c_str(), TEMP_PREFIX, DISK_BUFFER_SIZE, MYF(MY_WME)))
720
718
  {
721
719
    return 1;