~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/str/weight_string.cc

Merge Nathan

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include CSTDINT_H
22
22
#include <drizzled/function/str/weight_string.h>
23
23
 
 
24
#include <algorithm>
 
25
 
 
26
using namespace std;
 
27
 
24
28
void Item_func_weight_string::fix_length_and_dec()
25
29
{
26
30
  const CHARSET_INFO * const cs= args[0]->collation.collation;
27
31
  collation.set(&my_charset_bin, args[0]->collation.derivation);
28
32
  flags= my_strxfrm_flag_normalize(flags, cs->levels_for_order);
29
 
  max_length= cs->mbmaxlen * cmax(args[0]->max_length, nweights);
 
33
  max_length= cs->mbmaxlen * max(args[0]->max_length, nweights);
30
34
  maybe_null= 1;
31
35
}
32
36
 
43
47
    goto nl;
44
48
 
45
49
  tmp_length= cs->coll->strnxfrmlen(cs, cs->mbmaxlen *
46
 
                                        cmax(res->length(), nweights));
 
50
                                        max(res->length(), nweights));
47
51
 
48
52
  if (tmp_value.alloc(tmp_length))
49
53
    goto nl;