Commit c2f194f2 authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

repetable test replaced with inline function

parent 5de8c225
...@@ -1122,9 +1122,7 @@ JOIN::exec() ...@@ -1122,9 +1122,7 @@ JOIN::exec()
if (zero_result_cause) if (zero_result_cause)
{ {
(void) return_zero_rows(this, result, tables_list, fields_list, (void) return_zero_rows(this, result, tables_list, fields_list,
do_send_rows && send_row_on_empty_set(),
tmp_table_param.sum_func_count != 0 &&
!group_list,
select_options, select_options,
zero_result_cause, zero_result_cause,
having, procedure, having, procedure,
...@@ -5674,8 +5672,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure) ...@@ -5674,8 +5672,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
if (!(error=(*end_select)(join,join_tab,0)) || error == -3) if (!(error=(*end_select)(join,join_tab,0)) || error == -3)
error=(*end_select)(join,join_tab,1); error=(*end_select)(join,join_tab,1);
} }
else if (join->do_send_rows && join->tmp_table_param.sum_func_count != 0 && else if (join->send_row_on_empty_set())
!join->group_list)
error= join->result->send_data(*join->fields); error= join->result->send_data(*join->fields);
} }
else else
......
...@@ -299,6 +299,11 @@ class JOIN :public Sql_alloc ...@@ -299,6 +299,11 @@ class JOIN :public Sql_alloc
void join_free(bool full); void join_free(bool full);
void clear(); void clear();
bool save_join_tab(); bool save_join_tab();
bool send_row_on_empty_set()
{
return (do_send_rows && tmp_table_param.sum_func_count != 0 &&
!group_list);
}
}; };
......
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