~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/sort.cc

Merge Nathan

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "myisamdef.h"
22
22
#include <stddef.h>
23
23
#include <queue>
 
24
#include <algorithm>
24
25
 
25
26
/* static variables */
26
27
 
130
131
  sort_keys= (unsigned char **) NULL; error= 1;
131
132
  maxbuffer=1;
132
133
 
133
 
  memavl=cmax(sortbuff_size,MIN_SORT_MEMORY);
 
134
  memavl=max(sortbuff_size,(size_t)MIN_SORT_MEMORY);
134
135
  records=      info->sort_info->max_records;
135
136
  sort_length=  info->key_length;
136
137
 
341
342
    memset(&sort_param->unique, 0,  sizeof(sort_param->unique));
342
343
    sort_keys= (unsigned char **) NULL;
343
344
 
344
 
    memavl=       cmax(sort_param->sortbuff_size, MIN_SORT_MEMORY);
 
345
    memavl=       max(sort_param->sortbuff_size, (uint32_t)MIN_SORT_MEMORY);
345
346
    idx=          (uint)sort_param->sort_info->max_records;
346
347
    sort_length=  sort_param->key_length;
347
348
    maxbuffer=    1;
792
793
  register uint32_t count;
793
794
  uint32_t length;
794
795
 
795
 
  if ((count=(uint) cmin((ha_rows) buffpek->max_keys,buffpek->count)))
 
796
  if ((count=(uint) min((ha_rows) buffpek->max_keys,buffpek->count)))
796
797
  {
797
798
    if (my_pread(fromfile->file,(unsigned char*) buffpek->base,
798
799
                 (length= sort_length*count),buffpek->file_pos,MYF_RW))
813
814
  uint32_t idx;
814
815
  unsigned char *buffp;
815
816
 
816
 
  if ((count=(uint) cmin((ha_rows) buffpek->max_keys,buffpek->count)))
 
817
  if ((count=(uint) min((ha_rows) buffpek->max_keys,buffpek->count)))
817
818
  {
818
819
    buffp = buffpek->base;
819
820