summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2002-09-03 09:50:36 +0300
committerunknown <bell@sanja.is.com.ua>2002-09-03 09:50:36 +0300
commit3fbcafea9c5e85dc6315f0b89872ac5e273195c8 (patch)
tree80af274b045962ab1f5805301ffc1dfa15a21b96 /sql/sql_base.cc
parent1648e47889f6c981847ab300bf6e71d08c9f0667 (diff)
downloadmariadb-git-3fbcafea9c5e85dc6315f0b89872ac5e273195c8.tar.gz
subselect with union
new error handling Item_ref bug fixed include/mysql_com.h: new error handling query cache pointer description mysql-test/r/distinct.result: new result's after Monty's bug fixing mysql-test/r/subselect.result: subselect with union test mysql-test/t/subselect.test: subselect with union test sql/item.cc: subselect with union Item_ref bug fixed sql/item_cmpfunc.cc: Monty's bug fixing sql/item_subselect.cc: TODO changing subselect with union sql/item_subselect.h: subselect with union sql/mysql_priv.h: Item_ref bug fixed sql/mysqld.cc: new error handling sql/net_pkg.cc: new error handling sql/net_serv.cc: new error handling sql/sql_base.cc: Item_ref bug fixed sql/sql_class.cc: new error handling sql/sql_class.h: new error handling sql/sql_derived.cc: subselect with union sql/sql_insert.cc: new error handling (only with mysql_select now) sql/sql_lex.cc: subselect with union sql/sql_lex.h: subselect with union sql/sql_parse.cc: new error handling sql/sql_select.cc: new error handling subselect with union removed thd->where=0 hack sql/sql_select.h: subselect with union sql/sql_union.cc: subselect with union sql/sql_update.cc: new error handling (only with mysql_select now) sql/sql_yacc.yy: subselect with union
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc36
1 files changed, 20 insertions, 16 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index b3ef043f582..95f9e15331f 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1711,7 +1711,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;
@@ -1748,7 +1749,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)
@@ -1760,8 +1761,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
@@ -1778,8 +1780,9 @@ find_field_in_tables(THD *thd,Item_field *item,TABLE_LIST *tables)
{
if (!thd->where) // Returns first found
break;
- my_printf_error(ER_NON_UNIQ_ERROR,ER(ER_NON_UNIQ_ERROR),MYF(0),
- name,thd->where);
+ if (report_error)
+ my_printf_error(ER_NON_UNIQ_ERROR,ER(ER_NON_UNIQ_ERROR),MYF(0),
+ name,thd->where);
return (Field*) 0;
}
found=field;
@@ -1787,13 +1790,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;
@@ -1841,9 +1845,9 @@ find_item_in_list(Item *find,List<Item> &items)
break;
}
}
- if (!found && current_thd->where)
- my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),MYF(0),
- find->full_name(),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;
}
@@ -2303,8 +2307,8 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
int setup_ftfuncs(THD *thd)
{
- List_iterator<Item_func_match> li(thd->lex.select->ftfunc_list),
- lj(thd->lex.select->ftfunc_list);
+ List_iterator<Item_func_match> li(*(thd->lex.select->ftfunc_list)),
+ lj(*(thd->lex.select->ftfunc_list));
Item_func_match *ftf, *ftf2;
while ((ftf=li++))
@@ -2324,9 +2328,9 @@ int setup_ftfuncs(THD *thd)
int init_ftfuncs(THD *thd, bool no_order)
{
- if (thd->lex.select->ftfunc_list.elements)
+ if (thd->lex.select->ftfunc_list->elements)
{
- List_iterator<Item_func_match> li(thd->lex.select->ftfunc_list);
+ List_iterator<Item_func_match> li(*(thd->lex.select->ftfunc_list));
Item_func_match *ifm;
DBUG_PRINT("info",("Performing FULLTEXT search"));
thd->proc_info="FULLTEXT initialization";