summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-09-15 16:43:06 +0200
committerSergei Golubchik <serg@mariadb.org>2017-09-18 10:12:23 +0200
commit55c5448ab7030f458f6e06f380c9f605c1d8d3ba (patch)
treecec7698f32cd7c933fbd84d43f00be9b2e24dccf /sql
parent6670b4e58ca1c97b6f35277fc2aef93ee7367b89 (diff)
downloadmariadb-git-55c5448ab7030f458f6e06f380c9f605c1d8d3ba.tar.gz
MDEV-13751 Interrupted SELECT fails with 1030: 'Got error 1 "Operation not permitted" from storage engine MyISAM'
quick select returns 1, not proper HA_ERR_xxx error code, so don't send it to handler::print_error().
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_select.cc13
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,