~percona-core/percona-server/5.5

« back to all changes in this revision

Viewing changes to sql/item_strfunc.cc

  • Committer: Laurynas Biveinis
  • Date: 2014-09-25 11:15:38 UTC
  • mfrom: (698.1.1 merge-5.5.40)
  • Revision ID: laurynas.biveinis@percona.com-20140925111538-imh8ubwq91n3j5sp
AutomergeĀ lp:~laurynas-biveinis/percona-server/merge-5.5.40

Show diffs side-by-side

added added

removed removed

Lines of Context:
2814
2814
    rpad->set_charset(&my_charset_bin);
2815
2815
  }
2816
2816
 
 
2817
#ifdef USE_MB
 
2818
  if (use_mb(rpad->charset()))
 
2819
  {
 
2820
    // This will chop off any trailing illegal characters from rpad.
 
2821
    String *well_formed_pad= args[2]->check_well_formed_result(rpad, false);
 
2822
    if (!well_formed_pad)
 
2823
      goto err;
 
2824
  }
 
2825
#endif
 
2826
 
2817
2827
  if (count <= (res_char_length= res->numchars()))
2818
2828
  {                                             // String to pad is big enough
2819
2829
    res->length(res->charpos((int) count));     // Shorten result if longer
2917
2927
    pad->set_charset(&my_charset_bin);
2918
2928
  }
2919
2929
 
 
2930
#ifdef USE_MB
 
2931
  if (use_mb(pad->charset()))
 
2932
  {
 
2933
    // This will chop off any trailing illegal characters from pad.
 
2934
    String *well_formed_pad= args[2]->check_well_formed_result(pad, false);
 
2935
    if (!well_formed_pad)
 
2936
      goto err;
 
2937
  }
 
2938
#endif
 
2939
 
2920
2940
  res_char_length= res->numchars();
2921
2941
 
2922
2942
  if (count <= res_char_length)