diff options
author | evgen@moonbone.local <> | 2005-10-13 00:58:59 +0400 |
---|---|---|
committer | evgen@moonbone.local <> | 2005-10-13 00:58:59 +0400 |
commit | 551961b2079802afcbc703d340a58e71902a3bcf (patch) | |
tree | abbb9d4028e7ba336f6f3350a3b08d2e98a9f911 /sql/item.cc | |
parent | c16410d3a1d4cba759f7151bbb2dfa719edd9e6e (diff) | |
download | mariadb-git-551961b2079802afcbc703d340a58e71902a3bcf.tar.gz |
select.test, sql_select.cc, sql_lex.cc, item.cc:
Bug #7672 after merge fix
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/item.cc b/sql/item.cc index 3c3a6d273fe..8df839baa5c 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1760,10 +1760,15 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) if ((tmp= find_field_in_tables(thd, this, tables, &where, 0)) == not_found_field) { - if (thd->lex.select_lex.is_item_list_lookup) + /* Look up in current select's item_list to find aliased fields */ + if (thd->lex->current_select->is_item_list_lookup) { - Item** res= find_item_in_list(this, thd->lex.select_lex.item_list); - if (res && *res && (*res)->type() == Item::FIELD_ITEM) + uint counter; + bool not_used; + Item** res= find_item_in_list(this, thd->lex->current_select->item_list, + &counter, REPORT_EXCEPT_NOT_FOUND, + ¬_used); + if (res != not_found_item && (*res)->type() == Item::FIELD_ITEM) { set_field((*((Item_field**)res))->field); return 0; |