~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/filesort.cc

  • Committer: Brian Aker
  • Date: 2010-10-22 23:21:19 UTC
  • mto: This revision was merged to the branch mainline in revision 1874.
  • Revision ID: brian@tangent.org-20101022232119-pa9c8du0m7aaxuub
Update to remove additional goto.

Show diffs side-by-side

added added

removed removed

Lines of Context:
672
672
  if (!my_b_inited(tempfile) &&
673
673
      open_cached_file(tempfile, drizzle_tmpdir.c_str(), TEMP_PREFIX, DISK_BUFFER_SIZE,
674
674
                       MYF(MY_WME)))
675
 
    goto err;
 
675
  {
 
676
    return 1;
 
677
  }
676
678
  /* check we won't have more buffpeks than we can possibly keep in memory */
677
679
  if (my_b_tell(buffpek_pointers) + sizeof(buffpek) > (uint64_t)UINT_MAX)
678
 
    goto err;
 
680
  {
 
681
    return 1;
 
682
  }
 
683
 
679
684
  buffpek.file_pos= my_b_tell(tempfile);
680
685
  if ((ha_rows) count > param->max_rows)
681
686
    count=(uint32_t) param->max_rows;
682
687
  buffpek.count=(ha_rows) count;
683
688
  for (end=sort_keys+count ; sort_keys != end ; sort_keys++)
 
689
  {
684
690
    if (my_b_write(tempfile, (unsigned char*) *sort_keys, (uint32_t) rec_length))
685
 
      goto err;
 
691
    {
 
692
      return 1;
 
693
    }
 
694
  }
 
695
 
686
696
  if (my_b_write(buffpek_pointers, (unsigned char*) &buffpek, sizeof(buffpek)))
687
 
    goto err;
688
 
  return(0);
 
697
  {
 
698
    return 1;
 
699
  }
689
700
 
690
 
err:
691
 
  return(1);
 
701
  return 0;
692
702
} /* write_keys */
693
703
 
694
704