~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_string.cc

Merge Nathan

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include <algorithm>
23
23
 
 
24
using namespace std;
 
25
 
24
26
/*
25
27
  The following extern declarations are ok as these are interface functions
26
28
  required by the string function
483
485
 
484
486
int stringcmp(const String *s,const String *t)
485
487
{
486
 
  uint32_t s_len=s->length(),t_len=t->length(),len=cmin(s_len,t_len);
 
488
  uint32_t s_len= s->length(), t_len= t->length(), len= min(s_len,t_len);
487
489
  int cmp= memcmp(s->ptr(), t->ptr(), len);
488
490
  return (cmp) ? cmp : (int) (s_len - t_len);
489
491
}
500
502
  }
501
503
  if (to->realloc(from_length))
502
504
    return from;                                // Actually an error
503
 
  if ((to->str_length=cmin(from->str_length,from_length)))
 
505
  if ((to->str_length= min(from->str_length,from_length)))
504
506
    memcpy(to->Ptr,from->Ptr,to->str_length);
505
507
  to->str_charset=from->str_charset;
506
508
  return to;
629
631
 
630
632
  if (to_cs == &my_charset_bin)
631
633
  {
632
 
    res= cmin(cmin(nchars, to_length), from_length);
 
634
    res= min(min(nchars, to_length), from_length);
633
635
    memmove(to, from, res);
634
636
    *from_end_pos= from + res;
635
637
    *well_formed_error_pos= NULL;