summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-08-03 09:32:58 +0200
committerunknown <msvensson@neptunus.(none)>2006-08-03 09:32:58 +0200
commited44a2ee51d7ed34bc98178cd03b3260342c5c06 (patch)
treeef70ce093b8f53435eb03a5e77c0f0c6b76b7b77 /sql/item_sum.cc
parent695c534d76c68ce0b8afa9c261e41ab9a24d93b2 (diff)
parent3c8150b79bf5302879897e0d1ebd594798bb419e (diff)
downloadmariadb-git-ed44a2ee51d7ed34bc98178cd03b3260342c5c06.tar.gz
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint client/mysql.cc: Auto merged client/mysqltest.c: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/date_formats.result: Auto merged mysql-test/r/union.result: Auto merged mysql-test/t/union.test: Auto merged sql/field.cc: Auto merged sql/item.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/item_subselect.cc: Auto merged sql/item_sum.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/r/func_group.result: Merge manually mysql-test/t/func_group.test: Merge manually
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 898ea28985b..0d2a5b3b080 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -377,7 +377,13 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table,
case INT_RESULT:
return new Field_longlong(max_length,maybe_null,name,table,unsigned_flag);
case STRING_RESULT:
- if (max_length/collation.collation->mbmaxlen > 255 && convert_blob_length)
+ /*
+ Make sure that the blob fits into a Field_varstring which has
+ 2-byte lenght.
+ */
+ if (max_length/collation.collation->mbmaxlen > 255 &&
+ max_length/collation.collation->mbmaxlen < UINT_MAX16 &&
+ convert_blob_length)
return new Field_varstring(convert_blob_length, maybe_null,
name, table,
collation.collation);