diff options
author | unknown <gluh@eagle.intranet.mysql.r18.ru> | 2005-12-19 15:36:03 +0400 |
---|---|---|
committer | unknown <gluh@eagle.intranet.mysql.r18.ru> | 2005-12-19 15:36:03 +0400 |
commit | c7a440d1c6d0158a43880745971d20d95bcf6803 (patch) | |
tree | 6f48ac02b3b41e5fc0e2afe3f976b0659bba0c03 /sql | |
parent | 479a02fad565dbe2ef875f949e8306f8fde3e41f (diff) | |
download | mariadb-git-c7a440d1c6d0158a43880745971d20d95bcf6803.tar.gz |
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
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_select.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9b5b4b90ccb..1485f88610a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -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; |