diff --git a/sql/item.cc b/sql/item.cc index 9149a1240ea..cc41b83f8d9 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -5497,6 +5497,7 @@ bool Item_outer_ref::fix_fields(THD *thd, Item **reference) if (!outer_field->fixed && (outer_field->fix_fields(thd, reference))) return TRUE; + table_name= outer_field->table_name; return Item_direct_ref::fix_fields(thd, reference); } diff --git a/sql/item.h b/sql/item.h index 93b43c8b61a..ec6d4fabae5 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1968,7 +1968,6 @@ public: outer_field_arg->field_name), outer_field(outer_field_arg) { - table_name= my_strdup(outer_field_arg->table_name, MYF(MY_WME)); ref= (Item**)&outer_field; set_properties(); fixed= 0;