summaryrefslogtreecommitdiff
path: root/sql/item_subselect.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_subselect.h')
-rw-r--r--sql/item_subselect.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index c0746d08db7..0c62c3f8d02 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -751,7 +751,8 @@ public:
ROWID_MERGE_ENGINE, TABLE_SCAN_ENGINE};
subselect_engine(Item_subselect *si,
- select_result_interceptor *res)
+ select_result_interceptor *res):
+ thd(NULL)
{
result= res;
item= si;
@@ -767,7 +768,7 @@ public:
Should be called before prepare().
*/
void set_thd(THD *thd_arg);
- THD * get_thd() { return thd; }
+ THD * get_thd() { return thd ? thd : current_thd; }
virtual int prepare(THD *)= 0;
virtual void fix_length_and_dec(Item_cache** row)= 0;
/*