1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

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

Create tmp table filed using original item name when it's necessary


mysql-test/r/view.result:
  Fix for bug#14861 aliased column names are not preserved.
    test case
mysql-test/t/view.test:
  Fix for bug#14861 aliased column names are not preserved.
    test case
This commit is contained in:
unknown
2005-12-19 15:36:03 +04:00
parent 479a02fad5
commit c7a440d1c6
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;