Commit 6bd9f5c1 authored by kostja@bodhi.(none)'s avatar kostja@bodhi.(none)

Use thd->is_error() instead of direct access to thd->net.report_error

in evaluate_join_record().

A minor cleanup required for the fix for Bug#12713.
parent f60b8909
...@@ -122,7 +122,7 @@ static int do_select(JOIN *join,List<Item> *fields,TABLE *tmp_table, ...@@ -122,7 +122,7 @@ static int do_select(JOIN *join,List<Item> *fields,TABLE *tmp_table,
static enum_nested_loop_state static enum_nested_loop_state
evaluate_join_record(JOIN *join, JOIN_TAB *join_tab, evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
int error, my_bool *report_error); int error);
static enum_nested_loop_state static enum_nested_loop_state
evaluate_null_complemented_join_record(JOIN *join, JOIN_TAB *join_tab); evaluate_null_complemented_join_record(JOIN *join, JOIN_TAB *join_tab);
static enum_nested_loop_state static enum_nested_loop_state
...@@ -10871,7 +10871,6 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records) ...@@ -10871,7 +10871,6 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
int error; int error;
enum_nested_loop_state rc; enum_nested_loop_state rc;
my_bool *report_error= &(join->thd->net.report_error);
READ_RECORD *info= &join_tab->read_record; READ_RECORD *info= &join_tab->read_record;
if (join->resume_nested_loop) if (join->resume_nested_loop)
...@@ -10903,13 +10902,13 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records) ...@@ -10903,13 +10902,13 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
join->thd->row_count= 0; join->thd->row_count= 0;
error= (*join_tab->read_first_record)(join_tab); 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) while (rc == NESTED_LOOP_OK)
{ {
error= info->read_record(info); 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 && if (rc == NESTED_LOOP_NO_MORE_ROWS &&
...@@ -10933,13 +10932,13 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records) ...@@ -10933,13 +10932,13 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
static enum_nested_loop_state static enum_nested_loop_state
evaluate_join_record(JOIN *join, JOIN_TAB *join_tab, 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; bool not_used_in_distinct=join_tab->not_used_in_distinct;
ha_rows found_records=join->found_records; ha_rows found_records=join->found_records;
COND *select_cond= join_tab->select_cond; 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; return NESTED_LOOP_ERROR;
if (error < 0) if (error < 0)
return NESTED_LOOP_NO_MORE_ROWS; return NESTED_LOOP_NO_MORE_ROWS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment