From 75139c2bc1f8f1edcd10273f63a3a36ee6588c5a Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 2 Nov 2003 16:56:39 +0200 Subject: [PATCH] after review fix mysql-test/t/subselect.test: ufter merge fix --- mysql-test/t/subselect.test | 1 - sql/item.cc | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index a452bee79ea..9297573a6db 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -999,4 +999,3 @@ select * from t1 where (select count(*) from t2 group by t1.s2) = 1; -- error 1109 select count(*) from t2 group by t1.s2; drop table t1, t2; - diff --git a/sql/item.cc b/sql/item.cc index 9caea3cee4c..e1373cee41f 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -872,13 +872,16 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) else if (tmp == not_found_field && refer == (Item **)not_found_item) { if (upward_lookup) + { // We can't say exactly what absend table or field my_printf_error(ER_BAD_FIELD_ERROR, ER(ER_BAD_FIELD_ERROR), MYF(0), full_name(), thd->where); + } else + { // Call to report error find_field_in_tables(thd, this, tables, &where, 1); - + } return -1; } else if (refer != (Item **)not_found_item) @@ -1468,15 +1471,19 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) else if (ref == (Item **)not_found_item && tmp == not_found_field) { if (upward_lookup) + { // We can't say exactly what absend (table or field) my_printf_error(ER_BAD_FIELD_ERROR, ER(ER_BAD_FIELD_ERROR), MYF(0), full_name(), thd->where); + } else + { // Call to report error find_item_in_list(this, *(thd->lex.current_select->get_item_list()), &counter, REPORT_ALL_ERRORS); + } ref= 0; return 1; }