summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorigor@olga.mysql.com <>2007-07-04 21:12:07 -0700
committerigor@olga.mysql.com <>2007-07-04 21:12:07 -0700
commit4c02004da9ca0037731338c0fdd3fae8853de459 (patch)
treeeee5240eccde377dd6eef1c7ba965551141fc43b /sql/item.h
parentcdea05a79377865e0c89aaf72cdc24362b76887e (diff)
downloadmariadb-git-4c02004da9ca0037731338c0fdd3fae8853de459.tar.gz
Fixed bug #29392.
This bug may manifest itself for select queries over a multi-table view that includes an ORDER BY clause in its definition. If the select list of the query contains references to the same view column with different aliases the names of the columns in the result output will be nevertheless the same, coinciding with one of the alias. The bug happened because the method Item_ref::get_tmp_table_item that was inherited by the class Item_direct_view_ref ignored the fact that the name of the view column reference must be inherited by the fields of the temporary table that was created in order to get the result rows sorted.
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h
index 3478095351a..a880f86f601 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1983,6 +1983,12 @@ public:
bool fix_fields(THD *, Item **);
bool eq(const Item *item, bool binary_cmp) const;
+ Item *get_tmp_table_item(THD *thd)
+ {
+ Item *item= Item_ref::get_tmp_table_item(thd);
+ item->name= name;
+ return item;
+ }
virtual Ref_Type ref_type() { return VIEW_REF; }
};