~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 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:
121
121
    info->write_key=write_merge_key;
122
122
  }
123
123
 
124
 
  my_b_clear(&tempfile);
125
 
  my_b_clear(&tempfile_for_exceptions);
 
124
  tempfile.clear();
 
125
  tempfile_for_exceptions.clear();
126
126
  memset(&buffpek, 0, sizeof(buffpek));
127
127
  unsigned char** sort_keys= (unsigned char **) NULL; 
128
128
  int error= 1;
200
200
  if (flush_pending_blocks(info))
201
201
    goto err;
202
202
 
203
 
  if (my_b_inited(&tempfile_for_exceptions))
 
203
  if (tempfile_for_exceptions.inited())
204
204
  {
205
205
    MI_INFO *idx=info->sort_info->info;
206
206
    uint32_t     keyno=info->key;
399
399
        continue;
400
400
      }
401
401
    }
402
 
    if (my_b_inited(&sinfo->tempfile_for_exceptions))
 
402
    if (sinfo->tempfile_for_exceptions.inited())
403
403
    {
404
404
      uint32_t key_length;
405
405
 
438
438
  unsigned char **end;
439
439
  uint32_t sort_length=info->key_length;
440
440
 
441
 
  internal::my_qsort2((unsigned char*) sort_keys,count,sizeof(unsigned char*),(qsort2_cmp) info->key_cmp,
442
 
            info);
443
 
  if (!my_b_inited(tempfile) && tempfile->open_cached_file(P_tmpdir, "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
 
441
  internal::my_qsort2((unsigned char*) sort_keys,count,sizeof(unsigned char*),(qsort2_cmp) info->key_cmp, info);
 
442
  if (not tempfile->inited() && tempfile->open_cached_file(P_tmpdir, "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
444
443
    return(1);
445
444
 
446
445
  buffpek->file_pos=my_b_tell(tempfile);
478
477
  unsigned char **end;
479
478
  int err;
480
479
 
481
 
  internal::my_qsort2((unsigned char*) sort_keys,count,sizeof(unsigned char*),(qsort2_cmp) info->key_cmp,
482
 
            info);
483
 
  if (!my_b_inited(tempfile) && tempfile->open_cached_file(P_tmpdir, "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
 
480
  internal::my_qsort2((unsigned char*) sort_keys,count,sizeof(unsigned char*),(qsort2_cmp) info->key_cmp, info);
 
481
  if (not tempfile->inited() && tempfile->open_cached_file(P_tmpdir, "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
484
482
    return(1);
485
483
 
486
484
  buffpek->file_pos=my_b_tell(tempfile);
499
497
{
500
498
  uint32_t key_length=info->real_key_length;
501
499
 
502
 
  if (!my_b_inited(tempfile) && tempfile->open_cached_file(P_tmpdir, "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
 
500
  if (not tempfile->inited() && tempfile->open_cached_file(P_tmpdir, "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
503
501
    return(1);
504
502
 
505
503
  if (my_b_write(tempfile,(unsigned char*)&key_length,sizeof(key_length)) ||