diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-09-30 17:20:28 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-10-13 09:40:41 +0200 |
commit | a6de6408042267558d9fb1f8efa884f8d09d1a34 (patch) | |
tree | fceefefabd73b930d9f2d393a8e364953d66c6e8 /sql | |
parent | 1ae02f0e0d28bfca037ec35c4fda5b01c853b09f (diff) | |
download | mariadb-git-a6de6408042267558d9fb1f8efa884f8d09d1a34.tar.gz |
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().
Diffstat (limited to 'sql')
-rw-r--r-- | sql/select_handler.cc | 3 | ||||
-rw-r--r-- | sql/sql_class.cc | 12 | ||||
-rw-r--r-- | sql/sql_class.h | 4 | ||||
-rw-r--r-- | sql/sql_insert.cc | 3 | ||||
-rw-r--r-- | sql/sql_union.cc | 6 |
5 files changed, 6 insertions, 22 deletions
diff --git a/sql/select_handler.cc b/sql/select_handler.cc index b364cb12341..c8f92461fd0 100644 --- a/sql/select_handler.cc +++ b/sql/select_handler.cc @@ -103,9 +103,6 @@ bool Pushdown_select::send_data() Protocol *protocol= thd->protocol; DBUG_ENTER("Pushdown_select::send_data"); - if (thd->killed == ABORT_QUERY) - DBUG_RETURN(false); - protocol->prepare_for_resend(); if (protocol->send_result_set_row(&result_columns)) { diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 766deea3320..a4861620bf0 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -3015,9 +3015,6 @@ int select_send::send_data(List<Item> &items) Protocol *protocol= thd->protocol; DBUG_ENTER("select_send::send_data"); - if (thd->killed == ABORT_QUERY) - DBUG_RETURN(FALSE); - protocol->prepare_for_resend(); if (protocol->send_result_set_row(&items)) { @@ -3279,8 +3276,6 @@ int select_export::send_data(List<Item> &items) String tmp(buff,sizeof(buff),&my_charset_bin),*res; tmp.length(0); - if (thd->killed == ABORT_QUERY) - DBUG_RETURN(0); row_count++; Item *item; uint used_length=0,items_left=items.elements; @@ -3534,9 +3529,6 @@ int select_dump::send_data(List<Item> &items) Item *item; DBUG_ENTER("select_dump::send_data"); - if (thd->killed == ABORT_QUERY) - DBUG_RETURN(0); - if (row_count++ > 1) { 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) MYF(current_thd->lex->ignore ? ME_WARNING : 0)); DBUG_RETURN(1); } - if (thd->killed == ABORT_QUERY) - DBUG_RETURN(0); List_iterator_fast<Item> li(items); Item *val_item; for (uint i= 0; (val_item= li++); i++) @@ -3708,8 +3698,6 @@ int select_exists_subselect::send_data(List<Item> &items) { DBUG_ENTER("select_exists_subselect::send_data"); Item_exists_subselect *it= (Item_exists_subselect *)item; - if (thd->killed == ABORT_QUERY) - DBUG_RETURN(0); it->value= 1; it->assigned(1); DBUG_RETURN(0); diff --git a/sql/sql_class.h b/sql/sql_class.h index 36480b3f3e0..65b6595ed83 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -5101,6 +5101,10 @@ public: { if (u->lim.check_offset(sent)) return 0; + + if (u->thd->killed == ABORT_QUERY) + return 0; + return send_data(items); } /* diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index a0cdd530d9a..515f40212fb 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -3857,9 +3857,6 @@ int select_insert::send_data(List<Item> &values) DBUG_ENTER("select_insert::send_data"); bool error=0; - if (unlikely(thd->killed == ABORT_QUERY)) - DBUG_RETURN(0); - thd->count_cuted_fields= CHECK_FIELD_WARN; // Calculate cuted fields store_values(values); if (table->default_field && diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 47af00865c1..aba1107b6e8 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -111,8 +111,7 @@ int select_unit::send_data(List<Item> &values) { int rc= 0; int not_reported_error= 0; - if (thd->killed == ABORT_QUERY) - return 0; + if (table->no_rows_with_nulls) table->null_catch_flags= CHECK_ROW_FOR_NULLS_TO_REJECT; @@ -602,8 +601,7 @@ int select_unit_ext::send_data(List<Item> &values) int rc= 0; int not_reported_error= 0; int find_res; - if (thd->killed == ABORT_QUERY) - return 0; + if (table->no_rows_with_nulls) table->null_catch_flags= CHECK_ROW_FOR_NULLS_TO_REJECT; |