~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/sort.cc

  • Committer: Olaf van der Spek
  • Date: 2011-08-13 15:57:32 UTC
  • mto: This revision was merged to the branch mainline in revision 2407.
  • Revision ID: olafvdspek@gmail.com-20110813155732-jrr1aq3gyeyxl9qv
Move flush() into iocache

Show diffs side-by-side

added added

removed removed

Lines of Context:
188
188
      if (merge_many_buff(info,keys,sort_keys, (BUFFPEK*)buffpek.buffer, &maxbuffer, &tempfile))
189
189
        goto err;
190
190
    }
191
 
    if (internal::flush_io_cache(&tempfile) ||
 
191
    if (tempfile.flush() ||
192
192
        tempfile.reinit_io_cache(internal::READ_CACHE,0L,0,0))
193
193
      goto err;
194
194
    if (!no_messages)
209
209
    if (not no_messages)
210
210
      printf("  - Adding exceptions\n");
211
211
 
212
 
    if (flush_io_cache(&tempfile_for_exceptions) || tempfile_for_exceptions.reinit_io_cache(internal::READ_CACHE,0L,0,0))
 
212
    if (tempfile_for_exceptions.flush() || tempfile_for_exceptions.reinit_io_cache(internal::READ_CACHE,0L,0,0))
213
213
    {
214
214
      goto err;
215
215
    }
384
384
          continue;
385
385
        }
386
386
      }
387
 
      if (flush_io_cache(&sinfo->tempfile) || sinfo->tempfile.reinit_io_cache(internal::READ_CACHE,0L,0,0))
 
387
      if (sinfo->tempfile.flush() || sinfo->tempfile.reinit_io_cache(internal::READ_CACHE,0L,0,0))
388
388
      {
389
389
        got_error=1;
390
390
        continue;
406
406
      if (param->testflag & T_VERBOSE)
407
407
        printf("Key %d  - Dumping 'long' keys\n", sinfo->key+1);
408
408
 
409
 
      if (flush_io_cache(&sinfo->tempfile_for_exceptions) || sinfo->tempfile_for_exceptions.reinit_io_cache(internal::READ_CACHE,0L,0,0))
 
409
      if (sinfo->tempfile_for_exceptions.flush() || sinfo->tempfile_for_exceptions.reinit_io_cache(internal::READ_CACHE,0L,0,0))
410
410
      {
411
411
        got_error=1;
412
412
        continue;
537
537
 
538
538
  if (*maxbuffer < MERGEBUFF2)
539
539
    return(0);
540
 
  if (flush_io_cache(t_file) || t_file2.open_cached_file(P_tmpdir, "ST",
541
 
                       DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
 
540
  if (t_file->flush() || t_file2.open_cached_file(P_tmpdir, "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
542
541
    return(1);
543
542
 
544
543
  from_file= t_file ; to_file= &t_file2;
556
555
    if (merge_buffers(info,keys,from_file,to_file,sort_keys,lastbuff++,
557
556
                      buffpek+i,buffpek+ *maxbuffer))
558
557
      break;
559
 
    if (flush_io_cache(to_file))
 
558
    if (to_file->flush())
560
559
      break;
561
560
    temp=from_file; from_file=to_file; to_file=temp;
562
561
    *maxbuffer= (int) (lastbuff-buffpek)-1;