mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into rakia.(none):/home/kgeorge/mysql/autopush/B16712-5.0-opt sql/item_sum.cc: Auto merged sql/sql_select.cc: Auto merged
This commit is contained in:
@ -8034,7 +8034,12 @@ Field* create_tmp_field_from_field(THD *thd, Field* org_field,
|
||||
{
|
||||
Field *new_field;
|
||||
|
||||
if (convert_blob_length && (org_field->flags & BLOB_FLAG))
|
||||
/*
|
||||
Make sure that the blob fits into a Field_varstring which has
|
||||
2-byte lenght.
|
||||
*/
|
||||
if (convert_blob_length && convert_blob_length < UINT_MAX16 &&
|
||||
(org_field->flags & BLOB_FLAG))
|
||||
new_field= new Field_varstring(convert_blob_length,
|
||||
org_field->maybe_null(),
|
||||
org_field->field_name, table,
|
||||
@ -8116,8 +8121,13 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
|
||||
if ((type= item->field_type()) == MYSQL_TYPE_DATETIME ||
|
||||
type == MYSQL_TYPE_TIME || type == MYSQL_TYPE_DATE)
|
||||
new_field= item->tmp_table_field_from_field_type(table);
|
||||
/*
|
||||
Make sure that the blob fits into a Field_varstring which has
|
||||
2-byte lenght.
|
||||
*/
|
||||
else if (item->max_length/item->collation.collation->mbmaxlen > 255 &&
|
||||
convert_blob_length)
|
||||
item->max_length/item->collation.collation->mbmaxlen < UINT_MAX16
|
||||
&& convert_blob_length)
|
||||
new_field= new Field_varstring(convert_blob_length, maybe_null,
|
||||
item->name, table,
|
||||
item->collation.collation);
|
||||
|
Reference in New Issue
Block a user