summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2002-10-03 16:56:09 +0300
committermonty@mashka.mysql.fi <>2002-10-03 16:56:09 +0300
commit2e52a69b12f8787250d9664ba82f99daba022cab (patch)
tree32ad2b453c07e081d1b3b23780b839058042626d /sql/sql_base.cc
parent62a26cf891fdf4372e7773db3c413f0b7627910d (diff)
parent70ee4943ded0589a9a14794ea5f1be021406f1a8 (diff)
downloadmariadb-git-2e52a69b12f8787250d9664ba82f99daba022cab.tar.gz
Merge work:/my/mysql-4.1 into mashka.mysql.fi:/home/my/mysql-4.1
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc23
1 files changed, 13 insertions, 10 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 9f1d717a3c3..fb6f05848c7 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1783,7 +1783,8 @@ Field *find_field_in_table(THD *thd,TABLE *table,const char *name,uint length,
Field *
-find_field_in_tables(THD *thd,Item_field *item,TABLE_LIST *tables)
+find_field_in_tables(THD *thd,Item_field *item,TABLE_LIST *tables,
+ bool report_error)
{
Field *found=0;
const char *db=item->db_name;
@@ -1820,7 +1821,7 @@ find_field_in_tables(THD *thd,Item_field *item,TABLE_LIST *tables)
}
if (found)
return found;
- if (!found_table)
+ if (!found_table && report_error)
{
char buff[NAME_LEN*2+1];
if (db)
@@ -1832,8 +1833,9 @@ find_field_in_tables(THD *thd,Item_field *item,TABLE_LIST *tables)
thd->where);
}
else
- my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),MYF(0),
- item->full_name(),thd->where);
+ if (report_error)
+ my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),MYF(0),
+ item->full_name(),thd->where);
return (Field*) 0;
}
bool allow_rowid= tables && !tables->next; // Only one table
@@ -1848,7 +1850,7 @@ find_field_in_tables(THD *thd,Item_field *item,TABLE_LIST *tables)
return (Field*) 0;
if (found)
{
- if (!thd->where) // Returns first found
+ if (!report_error) // Returns first found
break;
my_printf_error(ER_NON_UNIQ_ERROR,ER(ER_NON_UNIQ_ERROR),MYF(0),
name,thd->where);
@@ -1859,13 +1861,14 @@ find_field_in_tables(THD *thd,Item_field *item,TABLE_LIST *tables)
}
if (found)
return found;
- my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),
- MYF(0),item->full_name(),thd->where);
+ if (report_error)
+ my_printf_error(ER_BAD_FIELD_ERROR, ER(ER_BAD_FIELD_ERROR),
+ MYF(0), item->full_name(), thd->where);
return (Field*) 0;
}
Item **
-find_item_in_list(Item *find,List<Item> &items)
+find_item_in_list(Item *find, List<Item> &items, bool report_error)
{
List_iterator<Item> li(items);
Item **found=0,*item;
@@ -1890,7 +1893,7 @@ find_item_in_list(Item *find,List<Item> &items)
{
if ((*found)->eq(item,0))
continue; // Same field twice (Access?)
- if (current_thd->where)
+ if (report_error)
my_printf_error(ER_NON_UNIQ_ERROR,ER(ER_NON_UNIQ_ERROR),MYF(0),
find->full_name(), current_thd->where);
return (Item**) 0;
@@ -1913,7 +1916,7 @@ find_item_in_list(Item *find,List<Item> &items)
break;
}
}
- if (!found && current_thd->where)
+ if (!found && report_error)
my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),MYF(0),
find->full_name(),current_thd->where);
return found;