~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item_strfunc.cc

  • Committer: Monty Taylor
  • Date: 2008-10-02 01:31:53 UTC
  • mfrom: (398.1.6 codestyle-new)
  • Revision ID: monty@inaugust.com-20081002013153-b097om921cd3j1pn
MergedĀ fromĀ stdint-includes-fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
          }
198
198
          else
199
199
          {
200
 
            uint new_len = max(tmp_value.alloced_length() * 2, concat_len);
 
200
            uint new_len = cmax(tmp_value.alloced_length() * 2, concat_len);
201
201
 
202
202
            if (tmp_value.realloc(new_len))
203
203
              goto null;
367
367
        }
368
368
        else
369
369
        {
370
 
          uint new_len = max(tmp_value.alloced_length() * 2, concat_len);
 
370
          uint new_len = cmax(tmp_value.alloced_length() * 2, concat_len);
371
371
 
372
372
          if (tmp_value.realloc(new_len))
373
373
            goto null;
849
849
 
850
850
  length= res->charpos((int) length, (uint32_t) start);
851
851
  tmp_length= res->length() - start;
852
 
  length= min(length, tmp_length);
 
852
  length= cmin(length, tmp_length);
853
853
 
854
854
  if (!start && (int64_t) res->length() == length)
855
855
    return res;
869
869
    if (start < 0)
870
870
      max_length= ((uint)(-start) > max_length) ? 0 : (uint)(-start);
871
871
    else
872
 
      max_length-= min((uint)(start - 1), max_length);
 
872
      max_length-= cmin((uint)(start - 1), max_length);
873
873
  }
874
874
  if (arg_count == 3 && args[2]->const_item())
875
875
  {
2124
2124
  const CHARSET_INFO * const cs= args[0]->collation.collation;
2125
2125
  collation.set(&my_charset_bin, args[0]->collation.derivation);
2126
2126
  flags= my_strxfrm_flag_normalize(flags, cs->levels_for_order);
2127
 
  max_length= cs->mbmaxlen * max(args[0]->max_length, nweights);
 
2127
  max_length= cs->mbmaxlen * cmax(args[0]->max_length, nweights);
2128
2128
  maybe_null= 1;
2129
2129
}
2130
2130
 
2142
2142
    goto nl;
2143
2143
  
2144
2144
  tmp_length= cs->coll->strnxfrmlen(cs, cs->mbmaxlen *
2145
 
                                        max(res->length(), nweights));
 
2145
                                        cmax(res->length(), nweights));
2146
2146
 
2147
2147
  if (tmp_value.alloc(tmp_length))
2148
2148
    goto nl;
2381
2381
 
2382
2382
void Item_func_export_set::fix_length_and_dec()
2383
2383
{
2384
 
  uint length=max(args[1]->max_length,args[2]->max_length);
 
2384
  uint length=cmax(args[1]->max_length,args[2]->max_length);
2385
2385
  uint sep_length=(arg_count > 3 ? args[3]->max_length : 1);
2386
2386
  max_length=length*64+sep_length*63;
2387
2387
 
2388
 
  if (agg_arg_charsets(collation, args+1, min((uint)4,arg_count)-1,
 
2388
  if (agg_arg_charsets(collation, args+1, cmin((uint)4,arg_count)-1,
2389
2389
                       MY_COLL_ALLOW_CONV, 1))
2390
2390
    return;
2391
2391
}