~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/func.cc

Merge Nathan

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include <drizzled/error.h>
32
32
#include <drizzled/check_stack_overrun.h>
33
33
#include <limits>
 
34
#include <algorithm>
34
35
 
35
36
using namespace std;
36
37
 
549
550
  int max_int_part= 0;
550
551
  decimals= 0;
551
552
  unsigned_flag= 1;
552
 
  for (uint32_t i=0 ; i < arg_count ; i++)
 
553
  for (uint32_t i= 0 ; i < arg_count ; i++)
553
554
  {
554
555
    set_if_bigger(decimals, args[i]->decimals);
555
556
    set_if_bigger(max_int_part, args[i]->decimal_int_part());
556
557
    set_if_smaller(unsigned_flag, args[i]->unsigned_flag);
557
558
  }
558
 
  int precision= cmin(max_int_part + decimals, DECIMAL_MAX_PRECISION);
 
559
  int precision= min(max_int_part + decimals, DECIMAL_MAX_PRECISION);
559
560
  max_length= my_decimal_precision_to_length(precision, decimals,
560
561
                                             unsigned_flag);
561
562
}