diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2016-12-19 22:03:28 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2017-10-13 12:35:17 +0200 |
commit | a4868c3509772da1666eb3d492515e7d39f8834d (patch) | |
tree | dcf4c1ab30383a0eef09c1cd86552de83b6a7f00 /sql/item.cc | |
parent | 991b9ee73597ba7287267207b3918e157e346899 (diff) | |
download | mariadb-git-a4868c3509772da1666eb3d492515e7d39f8834d.tar.gz |
MDEV-9208: Function->Function->View = Mysqld segfault (Server crashes in Dependency_marker::visit_field on 2nd execution with merged subquery)
Prevent crossing name resolution border in finding item tables.
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc index fdfbba31404..3100a4e3408 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -6876,7 +6876,11 @@ public: // Find which select the field is in. This is achieved by walking up // the select tree and looking for the table of interest. st_select_lex *sel; - for (sel= current_select; sel; sel= sel->outer_select()) + for (sel= current_select; + sel ; + sel= (sel->context.outer_context ? + sel->context.outer_context->select_lex: + NULL)) { List_iterator<TABLE_LIST> li(sel->leaf_tables); TABLE_LIST *tbl; |