mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
Fixed bug#14169: type of group_concat() result changed to blob if tmp_table was
used In a simple queries a result of the GROUP_CONCAT() function was always of varchar type. But if length of GROUP_CONCAT() result is greater than 512 chars and temporary table is used during select then the result is converted to blob, due to policy to not to store fields longer than 512 chars in tmp table as varchar fields. In order to provide consistent behaviour, result of GROUP_CONCAT() now will always be converted to blob if it is longer than 512 chars. Item_func_group_concat::field_type() is modified accordingly.
This commit is contained in:
@@ -4925,7 +4925,8 @@ 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);
|
||||
else if (item->max_length/item->collation.collation->mbmaxlen > 255)
|
||||
else if (item->max_length/item->collation.collation->mbmaxlen >
|
||||
CONVERT_IF_BIGGER_TO_BLOB)
|
||||
{
|
||||
if (convert_blob_length)
|
||||
new_field= new Field_varstring(convert_blob_length, maybe_null,
|
||||
@@ -5028,7 +5029,8 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
|
||||
return new Field_longlong(item_sum->max_length,maybe_null,
|
||||
item->name,table,item->unsigned_flag);
|
||||
case STRING_RESULT:
|
||||
if (item_sum->max_length > 255)
|
||||
if (item_sum->max_length/item_sum->collation.collation->mbmaxlen >
|
||||
CONVERT_IF_BIGGER_TO_BLOB)
|
||||
{
|
||||
if (convert_blob_length)
|
||||
return new Field_varstring(convert_blob_length, maybe_null,
|
||||
|
Reference in New Issue
Block a user