diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2016-07-29 18:21:08 +0200 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2016-09-02 16:20:38 +0300 |
commit | a6fb6473cf20c70589bb18adf346f3be8793603d (patch) | |
tree | c3869843b9216848380fa790739509d53ed32729 /sql/item_subselect.h | |
parent | addb38f4763faa0378cd369106372a0eb0f0ee75 (diff) | |
download | mariadb-git-a6fb6473cf20c70589bb18adf346f3be8793603d.tar.gz |
MDEV-10419: crash in mariadb 10.1.16-MariaDB-1~trusty
Fixed initialization and usage of THD reference in subselect engines.
Diffstat (limited to 'sql/item_subselect.h')
-rw-r--r-- | sql/item_subselect.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 178c875d5e5..435a4e820bb 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -762,7 +762,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; @@ -778,7 +779,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; /* |