diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2019-01-06 23:15:25 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2019-01-06 23:15:25 +0530 |
commit | d0d0f88f2cd4da23c2c2da702da51fb533e7fb8a (patch) | |
tree | 141f7989ec382336c00a85c6a08616843c544a08 /sql/sql_lex.cc | |
parent | b87eb04f77234acdbee1e626338ea95b04f4db2e (diff) | |
download | mariadb-git-d0d0f88f2cd4da23c2c2da702da51fb533e7fb8a.tar.gz |
MDEV-13784: query causes seg fault
When we have a nested subquery then a subquery that was a dependent subquery
may change to an independent one when we optimizer the inner subqueries.
This is handled st_select_lex::optimize_unflattened_subqueries.
Currently a subquery that was changed to independent from dependent after optimization
phase incorrectly shows dependent in the output of Explain, this happens because we
don't update used_tables for the WHERE clause, ON clause, etc after the optimization phase.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 891cf9987c6..08c169c5999 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -3551,6 +3551,7 @@ bool st_select_lex::optimize_unflattened_subqueries(bool const_only) inner_join->select_options|= SELECT_DESCRIBE; } res= inner_join->optimize(); + sl->update_used_tables(); sl->update_correlated_cache(); is_correlated_unit|= sl->is_correlated; inner_join->select_options= save_options; |