~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/sum.cc

  • Committer: Brian Aker
  • Date: 2011-09-26 15:02:54 UTC
  • mto: This revision was merged to the branch mainline in revision 2427.
  • Revision ID: brian@tangent.org-20110926150254-zpi0gifzexj2crdt
Wrap thread specfic

Show diffs side-by-side

added added

removed removed

Lines of Context:
2876
2876
                  Item_func_group_concat *item)
2877
2877
{
2878
2878
  Table *table= item->table;
2879
 
  String tmp((char *)table->getUpdateRecord(), table->getShare()->getRecordLength(), default_charset_info);
 
2879
  String tmp((char *)table->getUpdateRecord(), table->getShare()->getRecordLength(),
 
2880
             default_charset_info);
 
2881
  String tmp2;
2880
2882
  String *result= &item->result;
2881
2883
  Item **arg= item->args, **arg_end= item->args + item->arg_count_field;
2882
2884
  uint32_t old_length= result->length();
2916
2918
  if (result->length() > item->max_length)
2917
2919
  {
2918
2920
    int well_formed_error;
2919
 
    const charset_info_st& cs= *item->collation.collation;
 
2921
    const charset_info_st * const cs= item->collation.collation;
2920
2922
    const char *ptr= result->ptr();
 
2923
    uint32_t add_length;
2921
2924
    /*
2922
2925
      It's ok to use item->result.length() as the fourth argument
2923
2926
      as this is never used to limit the length of the data.
2924
2927
      Cut is done with the third argument.
2925
2928
    */
2926
 
    uint32_t add_length= cs.cset->well_formed_len(cs, str_ref(ptr + old_length, ptr + item->max_length), result->length(), &well_formed_error);
 
2929
    add_length= cs->cset->well_formed_len(cs,
 
2930
                                          ptr + old_length,
 
2931
                                          ptr + item->max_length,
 
2932
                                          result->length(),
 
2933
                                          &well_formed_error);
2927
2934
    result->length(old_length + add_length);
2928
2935
    item->count_cut_values++;
2929
2936
    item->warning_for_row= true;