1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge bk-internal.mysql.com:/home/bk/mysql-5.1-community

into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-forcollapseandmerge
This commit is contained in:
cmiller@zippy.cornsilk.net
2007-11-09 14:55:32 -05:00
177 changed files with 9488 additions and 1721 deletions

View File

@ -122,7 +122,7 @@ static int do_select(JOIN *join,List<Item> *fields,TABLE *tmp_table,
static enum_nested_loop_state
evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
int error, my_bool *report_error);
int error);
static enum_nested_loop_state
evaluate_null_complemented_join_record(JOIN *join, JOIN_TAB *join_tab);
static enum_nested_loop_state
@ -263,8 +263,8 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
result, unit, select_lex);
}
DBUG_PRINT("info",("res: %d report_error: %d", res,
thd->net.report_error));
res|= thd->net.report_error;
thd->is_error()));
res|= thd->is_error();
if (unlikely(res))
result->abort();
@ -491,7 +491,7 @@ JOIN::prepare(Item ***rref_pointer_array,
(having->fix_fields(thd, &having) ||
having->check_cols(1)));
select_lex->having_fix_field= 0;
if (having_fix_rc || thd->net.report_error)
if (having_fix_rc || thd->is_error())
DBUG_RETURN(-1); /* purecov: inspected */
thd->lex->allow_sum_func= save_allow_sum_func;
}
@ -818,7 +818,7 @@ JOIN::optimize()
}
conds= optimize_cond(this, conds, join_list, &cond_value);
if (thd->net.report_error)
if (thd->is_error())
{
error= 1;
DBUG_PRINT("error",("Error from optimize_cond"));
@ -827,7 +827,7 @@ JOIN::optimize()
{
having= optimize_cond(this, having, join_list, &having_value);
if (thd->net.report_error)
if (thd->is_error())
{
error= 1;
DBUG_PRINT("error",("Error from optimize_cond"));
@ -1039,7 +1039,7 @@ JOIN::optimize()
{
ORDER *org_order= order;
order=remove_const(this, order,conds,1, &simple_order);
if (thd->net.report_error)
if (thd->is_error())
{
error= 1;
DBUG_PRINT("error",("Error from remove_const"));
@ -1170,7 +1170,7 @@ JOIN::optimize()
group_list= remove_const(this, (old_group_list= group_list), conds,
rollup.state == ROLLUP::STATE_NONE,
&simple_group);
if (thd->net.report_error)
if (thd->is_error())
{
error= 1;
DBUG_PRINT("error",("Error from remove_const"));
@ -1193,7 +1193,7 @@ JOIN::optimize()
{
group_list= procedure->group= remove_const(this, procedure->group, conds,
1, &simple_group);
if (thd->net.report_error)
if (thd->is_error())
{
error= 1;
DBUG_PRINT("error",("Error from remove_const"));
@ -2116,10 +2116,10 @@ JOIN::exec()
}
}
}
/* XXX: When can we have here thd->net.report_error not zero? */
if (thd->net.report_error)
/* XXX: When can we have here thd->is_error() not zero? */
if (thd->is_error())
{
error= thd->net.report_error;
error= thd->is_error();
DBUG_VOID_RETURN;
}
curr_join->having= curr_join->tmp_having;
@ -2325,7 +2325,7 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
join->having_history= (join->having?join->having:join->tmp_having);
}
if (thd->net.report_error)
if (thd->is_error())
goto err;
join->exec();
@ -2351,8 +2351,7 @@ err:
{
thd_proc_info(thd, "end");
err|= select_lex->cleanup();
thd_proc_info(thd, "end");
DBUG_RETURN(err || thd->net.report_error);
DBUG_RETURN(err || thd->is_error());
}
DBUG_RETURN(join->error);
}
@ -6670,7 +6669,7 @@ void JOIN::cleanup(bool full)
for (tab= join_tab, end= tab+tables; tab != end; tab++)
{
if (tab->table)
tab->table->file->ha_index_or_rnd_end();
tab->table->file->ha_index_or_rnd_end();
}
}
}
@ -10729,7 +10728,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
DBUG_PRINT("error",("Error: do_select() failed"));
}
#endif
DBUG_RETURN(join->thd->net.report_error ? -1 : rc);
DBUG_RETURN(join->thd->is_error() ? -1 : rc);
}
@ -10883,7 +10882,6 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
int error;
enum_nested_loop_state rc;
my_bool *report_error= &(join->thd->net.report_error);
READ_RECORD *info= &join_tab->read_record;
if (join->resume_nested_loop)
@ -10915,13 +10913,13 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
join->thd->row_count= 0;
error= (*join_tab->read_first_record)(join_tab);
rc= evaluate_join_record(join, join_tab, error, report_error);
rc= evaluate_join_record(join, join_tab, error);
}
while (rc == NESTED_LOOP_OK)
{
error= info->read_record(info);
rc= evaluate_join_record(join, join_tab, error, report_error);
rc= evaluate_join_record(join, join_tab, error);
}
if (rc == NESTED_LOOP_NO_MORE_ROWS &&
@ -10945,13 +10943,13 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
static enum_nested_loop_state
evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
int error, my_bool *report_error)
int error)
{
bool not_used_in_distinct=join_tab->not_used_in_distinct;
ha_rows found_records=join->found_records;
COND *select_cond= join_tab->select_cond;
if (error > 0 || (*report_error)) // Fatal error
if (error > 0 || (join->thd->is_error())) // Fatal error
return NESTED_LOOP_ERROR;
if (error < 0)
return NESTED_LOOP_NO_MORE_ROWS;
@ -16062,7 +16060,7 @@ bool mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result)
first->options | thd->options | SELECT_DESCRIBE,
result, unit, first);
}
DBUG_RETURN(res || thd->net.report_error);
DBUG_RETURN(res || thd->is_error());
}