~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to sql/item_sum.cc

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-02-14 23:59:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120214235922-cux5uek1e5l0hje9
Tags: 5.5.20-0ubuntu1
* New upstream release.
* d/mysql-server-5.5.mysql.upstart: Fix stop on to make sure mysql is
  fully stopped before shutdown commences. (LP: #688541) Also simplify
  start on as it is redundant.
* d/control: Depend on upstart version which has apparmor profile load
  script to prevent failure on upgrade from lucid to precise.
  (LP: #907465)
* d/apparmor-profile: need to allow /run since that is the true path
  of /var/run files. (LP: #917542)
* d/control: mysql-server-5.5 has files in it that used to be owned
  by libmysqlclient-dev, so it must break/replace it. (LP: #912487)
* d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
  change compiler back to system default.
* d/rules: Turn off embedded libedit/readline.(Closes: #659566)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3128
3128
}
3129
3129
 
3130
3130
 
 
3131
Field *Item_func_group_concat::make_string_field(TABLE *table)
 
3132
{
 
3133
  Field *field;
 
3134
  DBUG_ASSERT(collation.collation);
 
3135
  /*
 
3136
    max_characters is maximum number of characters
 
3137
    what can fit into max_length size. It's necessary
 
3138
    to use field size what allows to store group_concat
 
3139
    result without truncation. For this purpose we use
 
3140
    max_characters * CS->mbmaxlen.
 
3141
  */
 
3142
  const uint32 max_characters= max_length / collation.collation->mbminlen;
 
3143
  if (max_characters > CONVERT_IF_BIGGER_TO_BLOB)
 
3144
    field= new Field_blob(max_characters * collation.collation->mbmaxlen,
 
3145
                          maybe_null, name, collation.collation, TRUE);
 
3146
  else
 
3147
    field= new Field_varstring(max_characters * collation.collation->mbmaxlen,
 
3148
                               maybe_null, name, table->s, collation.collation);
 
3149
 
 
3150
  if (field)
 
3151
    field->init(table);
 
3152
  return field;
 
3153
}
 
3154
 
 
3155
 
3131
3156
Item *Item_func_group_concat::copy_or_same(THD* thd)
3132
3157
{
3133
3158
  return new (thd->mem_root) Item_func_group_concat(thd, this);