diff options
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc index 13433990107..df42b9185cc 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -472,7 +472,8 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) REPORT_EXCEPT_NOT_FOUND)) != (Item **)not_found_item) break; - + if (sl->linkage == DERIVED_TABLE_TYPE) + break; // do not look over derived table } if (!tmp) return -1; @@ -887,6 +888,8 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) if ((tmp= find_field_in_tables(thd, this, sl->get_table_list(), 0)) != not_found_field); + if (sl->linkage == DERIVED_TABLE_TYPE) + break; // do not look over derived table } if (!ref) |