diff options
author | Roman Nozdrin <roman.nozdrin@mariadb.com> | 2019-08-24 18:42:35 +0300 |
---|---|---|
committer | Roman Nozdrin <roman.nozdrin@mariadb.com> | 2019-08-24 18:42:35 +0300 |
commit | edcdbae93cf64a6983c2ed026501b11c614c9712 (patch) | |
tree | bd0905e5361cede401cbc2efef4dbcd59e86e595 | |
parent | 1d15a28e52e41fae0847284089b2073ab33162a5 (diff) | |
download | mariadb-git-bb-10.4-MDEV-19831_2.tar.gz |
MDEV-19831 find_select_handler() now tries its best to find a handlerton that is able to processes the whole query. For that it traverses tables from subqueries.bb-10.4-MDEV-19831_2
Select_handler now cleans up temporary table structures on dctor call.
-rw-r--r-- | sql/select_handler.cc | 2 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/sql/select_handler.cc b/sql/select_handler.cc index f020d2f6b80..b364cb12341 100644 --- a/sql/select_handler.cc +++ b/sql/select_handler.cc @@ -45,6 +45,8 @@ Pushdown_select::Pushdown_select(SELECT_LEX *sel, select_handler *h) Pushdown_select::~Pushdown_select() { + if (handler->table) + free_tmp_table(handler->thd, handler->table); delete handler; select->select_h= NULL; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e79e96bf210..dbd035720f1 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -28551,7 +28551,7 @@ select_handler *SELECT_LEX::find_select_handler(THD *thd) return 0; if (master_unit()->outer_select()) return 0; - for (TABLE_LIST *tbl= join->tables_list; tbl; tbl= tbl->next_local) + for (TABLE_LIST *tbl= join->tables_list; tbl; tbl= tbl->next_global) { if (!tbl->table) continue; |