mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
manual merge of bug fix#12537
sql/item.cc: Auto merged sql/sql_select.cc: manual merge
This commit is contained in:
@ -4899,6 +4899,8 @@ static Field* create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
|
||||
item->name, table, item->unsigned_flag);
|
||||
break;
|
||||
case STRING_RESULT:
|
||||
DBUG_ASSERT(item->collation.collation);
|
||||
|
||||
enum enum_field_types type;
|
||||
/*
|
||||
DATE/TIME fields have STRING_RESULT result type. To preserve
|
||||
@ -4907,7 +4909,7 @@ 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 > 255)
|
||||
else if (item->max_length/item->collation.collation->mbmaxlen > 255)
|
||||
{
|
||||
if (convert_blob_length)
|
||||
new_field= new Field_varstring(convert_blob_length, maybe_null,
|
||||
|
Reference in New Issue
Block a user