From c2f194f243314ae3dcd5926dd26f0f686508c75f Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Tue, 4 May 2004 16:37:04 +0300 Subject: [PATCH] repetable test replaced with inline function --- sql/sql_select.cc | 7 ++----- sql/sql_select.h | 5 +++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 119cdf94401..f850c2ac270 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1122,9 +1122,7 @@ JOIN::exec() if (zero_result_cause) { (void) return_zero_rows(this, result, tables_list, fields_list, - do_send_rows && - tmp_table_param.sum_func_count != 0 && - !group_list, + send_row_on_empty_set(), select_options, zero_result_cause, having, procedure, @@ -5674,8 +5672,7 @@ do_select(JOIN *join,List *fields,TABLE *table,Procedure *procedure) if (!(error=(*end_select)(join,join_tab,0)) || error == -3) error=(*end_select)(join,join_tab,1); } - else if (join->do_send_rows && join->tmp_table_param.sum_func_count != 0 && - !join->group_list) + else if (join->send_row_on_empty_set()) error= join->result->send_data(*join->fields); } else diff --git a/sql/sql_select.h b/sql/sql_select.h index fea3f7c6b80..5a246a477cf 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -299,6 +299,11 @@ class JOIN :public Sql_alloc void join_free(bool full); void clear(); bool save_join_tab(); + bool send_row_on_empty_set() + { + return (do_send_rows && tmp_table_param.sum_func_count != 0 && + !group_list); + } };