summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 51c8ba6e5da..024b0ecfb42 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -381,7 +381,9 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table,
field= new Field_longlong(max_length, maybe_null, name, unsigned_flag);
break;
case STRING_RESULT:
- if (max_length/collation.collation->mbmaxlen <= 255 || !convert_blob_length)
+ if (max_length/collation.collation->mbmaxlen <= 255 ||
+ max_length/collation.collation->mbmaxlen >=UINT_MAX16 ||
+ !convert_blob_length)
return make_string_field(table);
field= new Field_varstring(convert_blob_length, maybe_null,
name, table->s, collation.collation);