summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index fa776ea3dca..f89ca2d7955 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -249,9 +249,13 @@ bool Item_subselect::exec()
{
int res;
- if (thd->is_error())
- /* Do not execute subselect in case of a fatal error */
+ /*
+ Do not execute subselect in case of a fatal error
+ or if the query has been killed.
+ */
+ if (thd->is_error() || thd->killed)
return 1;
+
/*
Simulate a failure in sub-query execution. Used to test e.g.
out of memory or query being killed conditions.
@@ -480,6 +484,7 @@ Item_singlerow_subselect::select_transformer(JOIN *join)
void Item_singlerow_subselect::store(uint i, Item *item)
{
row[i]->store(item);
+ row[i]->cache_value();
}
enum Item_result Item_singlerow_subselect::result_type() const
@@ -1831,6 +1836,7 @@ void subselect_engine::set_row(List<Item> &item_list, Item_cache **row)
if (!(row[i]= Item_cache::get_cache(sel_item)))
return;
row[i]->setup(sel_item);
+ row[i]->store(sel_item);
}
if (item_list.elements > 1)
res_type= ROW_RESULT;