summaryrefslogtreecommitdiff
path: root/sql/opt_subselect.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2014-01-23 21:26:04 +0400
committerSergey Petrunya <psergey@askmonty.org>2014-01-23 21:26:04 +0400
commit519c7305ac4e1e4bafe0acc56764fa40a0e621ab (patch)
tree83890384c6954e2e1206198169118ed45d4c1422 /sql/opt_subselect.cc
parentd9cb1352c8256d9c19a3d29af6fe3d705578a413 (diff)
downloadmariadb-git-519c7305ac4e1e4bafe0acc56764fa40a0e621ab.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 adb67e5169a..07dbb3991b0 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -1509,7 +1509,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 */