mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
subselect with union
new error handling Item_ref bug fixed
This commit is contained in:
@ -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";
|
||||
|
Reference in New Issue
Block a user