diff options
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e933be390af..326e87f9d91 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -19456,7 +19456,6 @@ bool test_if_use_dynamic_range_scan(JOIN_TAB *join_tab) int join_init_read_record(JOIN_TAB *tab) { - int error; /* Note: the query plan tree for the below operations is constructed in save_agg_explain_data. @@ -19466,12 +19465,18 @@ int join_init_read_record(JOIN_TAB *tab) if (tab->filesort && tab->sort_table()) // Sort table. return 1; - if (tab->select && tab->select->quick && (error= tab->select->quick->reset())) + DBUG_EXECUTE_IF("kill_join_init_read_record", + tab->join->thd->set_killed(KILL_QUERY);); + if (tab->select && tab->select->quick && tab->select->quick->reset()) { - /* Ensures error status is propageted back to client */ - report_error(tab->table, error); + /* Ensures error status is propagated back to client */ + report_error(tab->table, + tab->join->thd->killed ? HA_ERR_QUERY_INTERRUPTED : HA_ERR_OUT_OF_MEM); return 1; } + /* make sure we won't get ER_QUERY_INTERRUPTED from any code below */ + DBUG_EXECUTE_IF("kill_join_init_read_record", + tab->join->thd->reset_killed();); if (!tab->preread_init_done && tab->preread_init()) return 1; if (init_read_record(&tab->read_record, tab->join->thd, tab->table, |