summaryrefslogtreecommitdiff
path: root/sql/opt_subselect.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2014-01-23 15:41:51 +0400
committerSergey Petrunya <psergey@askmonty.org>2014-01-23 15:41:51 +0400
commitf0fa66a26de19d4f31a0b5466ac064650c81464a (patch)
treef94f4339e6905578c8993d4de57af7ff7014c9be /sql/opt_subselect.cc
parent5e02635eb846214b462ed4ab45b2142a08dc5a91 (diff)
downloadmariadb-git-f0fa66a26de19d4f31a0b5466ac064650c81464a.tar.gz
MDEV-5368: Server crashes in Item_in_subselect::optimize on ...
- convert_subq_to_sj() must connect child select's tables into parent select's TABLE_LIST::next_local chain. - The problem was that it took child's leaf_tables.head() which is different. This could cause certain tables (in this bug's case, child select's non-merged semi-join) not to be present in TABLE_LIST::next_local chain. Which would cause non-merged semi-join not to be initialized in setup_tables(), which would lead to NULL pointer dereference.
Diffstat (limited to 'sql/opt_subselect.cc')
-rw-r--r--sql/opt_subselect.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index ec56994f16a..b8780b4c4ca 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -1525,7 +1525,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
for (tl= (TABLE_LIST*)(parent_lex->table_list.first); tl->next_local; tl= tl->next_local)
{}
- tl->next_local= subq_lex->leaf_tables.head();
+ tl->next_local= subq_lex->join->tables_list;
/* A theory: no need to re-connect the next_global chain */