~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/statement_transform.cc

  • Committer: Lee Bieber
  • Date: 2010-08-05 19:24:12 UTC
  • mfrom: (1638.8.11)
  • mto: This revision was merged to the branch mainline in revision 1688.
  • Revision ID: lbieber@kalebral-2.local-20100805192412-5n6vspmfzkugodx1
Merge Stewart - make the compare_length() of index parts of VARCHAR and BLOB (i.e. those with charsets) be a length in characters instead of bytes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1061
1061
    {
1062
1062
      if (part.has_compare_length())
1063
1063
      {
1064
 
        size_t compare_length_in_chars= part.compare_length();
1065
 
        
1066
 
        /* hack: compare_length() is bytes, not chars, but
1067
 
         * only for VARCHAR. Ass. */
1068
 
        if (field.type() == Table::Field::VARCHAR)
1069
 
          compare_length_in_chars/= 4;
1070
 
 
1071
 
        if (compare_length_in_chars != field.string_options().length())
 
1064
        if (part.compare_length() != field.string_options().length())
1072
1065
        {
1073
1066
          stringstream ss;
1074
1067
          destination.push_back('(');
1075
 
          ss << compare_length_in_chars;
 
1068
          ss << part.compare_length();
1076
1069
          destination.append(ss.str());
1077
1070
          destination.push_back(')');
1078
1071
        }