Commit a6de6408 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-18553: MDEV-16327 pre-requisits part 3: move kill check in one place

Kill check moved from send_data() methids in its wrapper:
send_data_with_check().
parent 1ae02f0e
...@@ -103,9 +103,6 @@ bool Pushdown_select::send_data() ...@@ -103,9 +103,6 @@ bool Pushdown_select::send_data()
Protocol *protocol= thd->protocol; Protocol *protocol= thd->protocol;
DBUG_ENTER("Pushdown_select::send_data"); DBUG_ENTER("Pushdown_select::send_data");
if (thd->killed == ABORT_QUERY)
DBUG_RETURN(false);
protocol->prepare_for_resend(); protocol->prepare_for_resend();
if (protocol->send_result_set_row(&result_columns)) if (protocol->send_result_set_row(&result_columns))
{ {
......
...@@ -3015,9 +3015,6 @@ int select_send::send_data(List<Item> &items) ...@@ -3015,9 +3015,6 @@ int select_send::send_data(List<Item> &items)
Protocol *protocol= thd->protocol; Protocol *protocol= thd->protocol;
DBUG_ENTER("select_send::send_data"); DBUG_ENTER("select_send::send_data");
if (thd->killed == ABORT_QUERY)
DBUG_RETURN(FALSE);
protocol->prepare_for_resend(); protocol->prepare_for_resend();
if (protocol->send_result_set_row(&items)) if (protocol->send_result_set_row(&items))
{ {
...@@ -3279,8 +3276,6 @@ int select_export::send_data(List<Item> &items) ...@@ -3279,8 +3276,6 @@ int select_export::send_data(List<Item> &items)
String tmp(buff,sizeof(buff),&my_charset_bin),*res; String tmp(buff,sizeof(buff),&my_charset_bin),*res;
tmp.length(0); tmp.length(0);
if (thd->killed == ABORT_QUERY)
DBUG_RETURN(0);
row_count++; row_count++;
Item *item; Item *item;
uint used_length=0,items_left=items.elements; uint used_length=0,items_left=items.elements;
...@@ -3534,9 +3529,6 @@ int select_dump::send_data(List<Item> &items) ...@@ -3534,9 +3529,6 @@ int select_dump::send_data(List<Item> &items)
Item *item; Item *item;
DBUG_ENTER("select_dump::send_data"); DBUG_ENTER("select_dump::send_data");
if (thd->killed == ABORT_QUERY)
DBUG_RETURN(0);
if (row_count++ > 1) if (row_count++ > 1)
{ {
my_message(ER_TOO_MANY_ROWS, ER_THD(thd, ER_TOO_MANY_ROWS), MYF(0)); my_message(ER_TOO_MANY_ROWS, ER_THD(thd, ER_TOO_MANY_ROWS), MYF(0));
...@@ -3572,8 +3564,6 @@ int select_singlerow_subselect::send_data(List<Item> &items) ...@@ -3572,8 +3564,6 @@ int select_singlerow_subselect::send_data(List<Item> &items)
MYF(current_thd->lex->ignore ? ME_WARNING : 0)); MYF(current_thd->lex->ignore ? ME_WARNING : 0));
DBUG_RETURN(1); DBUG_RETURN(1);
} }
if (thd->killed == ABORT_QUERY)
DBUG_RETURN(0);
List_iterator_fast<Item> li(items); List_iterator_fast<Item> li(items);
Item *val_item; Item *val_item;
for (uint i= 0; (val_item= li++); i++) for (uint i= 0; (val_item= li++); i++)
...@@ -3708,8 +3698,6 @@ int select_exists_subselect::send_data(List<Item> &items) ...@@ -3708,8 +3698,6 @@ int select_exists_subselect::send_data(List<Item> &items)
{ {
DBUG_ENTER("select_exists_subselect::send_data"); DBUG_ENTER("select_exists_subselect::send_data");
Item_exists_subselect *it= (Item_exists_subselect *)item; Item_exists_subselect *it= (Item_exists_subselect *)item;
if (thd->killed == ABORT_QUERY)
DBUG_RETURN(0);
it->value= 1; it->value= 1;
it->assigned(1); it->assigned(1);
DBUG_RETURN(0); DBUG_RETURN(0);
......
...@@ -5101,6 +5101,10 @@ class select_result_sink: public Sql_alloc ...@@ -5101,6 +5101,10 @@ class select_result_sink: public Sql_alloc
{ {
if (u->lim.check_offset(sent)) if (u->lim.check_offset(sent))
return 0; return 0;
if (u->thd->killed == ABORT_QUERY)
return 0;
return send_data(items); return send_data(items);
} }
/* /*
......
...@@ -3857,9 +3857,6 @@ int select_insert::send_data(List<Item> &values) ...@@ -3857,9 +3857,6 @@ int select_insert::send_data(List<Item> &values)
DBUG_ENTER("select_insert::send_data"); DBUG_ENTER("select_insert::send_data");
bool error=0; bool error=0;
if (unlikely(thd->killed == ABORT_QUERY))
DBUG_RETURN(0);
thd->count_cuted_fields= CHECK_FIELD_WARN; // Calculate cuted fields thd->count_cuted_fields= CHECK_FIELD_WARN; // Calculate cuted fields
store_values(values); store_values(values);
if (table->default_field && if (table->default_field &&
......
...@@ -111,8 +111,7 @@ int select_unit::send_data(List<Item> &values) ...@@ -111,8 +111,7 @@ int select_unit::send_data(List<Item> &values)
{ {
int rc= 0; int rc= 0;
int not_reported_error= 0; int not_reported_error= 0;
if (thd->killed == ABORT_QUERY)
return 0;
if (table->no_rows_with_nulls) if (table->no_rows_with_nulls)
table->null_catch_flags= CHECK_ROW_FOR_NULLS_TO_REJECT; table->null_catch_flags= CHECK_ROW_FOR_NULLS_TO_REJECT;
...@@ -602,8 +601,7 @@ int select_unit_ext::send_data(List<Item> &values) ...@@ -602,8 +601,7 @@ int select_unit_ext::send_data(List<Item> &values)
int rc= 0; int rc= 0;
int not_reported_error= 0; int not_reported_error= 0;
int find_res; int find_res;
if (thd->killed == ABORT_QUERY)
return 0;
if (table->no_rows_with_nulls) if (table->no_rows_with_nulls)
table->null_catch_flags= CHECK_ROW_FOR_NULLS_TO_REJECT; table->null_catch_flags= CHECK_ROW_FOR_NULLS_TO_REJECT;
......
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