1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-29 00:08:14 +03:00

Fix for bug#14861 aliased column names are not preserved.

Create tmp table filed using original item name when it's necessary
This commit is contained in:
gluh@eagle.intranet.mysql.r18.ru
2005-12-19 15:36:03 +04:00
parent c8631b414b
commit f4b052844f
3 changed files with 42 additions and 5 deletions

View File

@@ -8189,7 +8189,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
uint convert_blob_length)
{
Item::Type orig_type= type;
Item *orig_item;
Item *orig_item= 0;
if (type != Item::FIELD_ITEM &&
item->real_item()->type() == Item::FIELD_ITEM &&
@@ -8240,10 +8240,12 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
}
else
result= create_tmp_field_from_field(thd, (*from_field= field->field),
item->name, table,
modify_item ? field :
NULL,
convert_blob_length);
orig_item ? orig_item->name :
item->name,
table,
modify_item ? field :
NULL,
convert_blob_length);
if (orig_type == Item::REF_ITEM && orig_modify)
((Item_ref*)orig_item)->set_result_field(result);
return result;