diff options
author | sergefp@mysql.com <> | 2005-04-23 06:55:43 +0400 |
---|---|---|
committer | sergefp@mysql.com <> | 2005-04-23 06:55:43 +0400 |
commit | 51064c0575d0ccf0c3b563f8f2d5591d40e50345 (patch) | |
tree | 4f9a95a220dac27dcefc1159d116f4394dc137fa /sql/sql_view.cc | |
parent | d7a1549b075bbae41862531ca7cc4e7ef6b4952e (diff) | |
download | mariadb-git-51064c0575d0ccf0c3b563f8f2d5591d40e50345.tar.gz |
Fix for BUG#10107: Memory leak in view over subquery:
In mysql_make_view when joining subquery lists, take into account that both lists
can have length > 1 (see also fix for BUG#8490)
(note to bk trigger: this commit is about BUG#10107)
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r-- | sql/sql_view.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 21de99f2484..ce08763015f 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -808,13 +808,15 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table) NOTE: we do not support UNION here, so we take only one select */ SELECT_LEX_NODE *end_unit= table->select_lex->slave; + SELECT_LEX_UNIT *next_unit; for (SELECT_LEX_UNIT *unit= lex->select_lex.first_inner_unit(); unit; - unit= unit->next_unit()) + unit= next_unit) { - SELECT_LEX_NODE *save_slave= unit->slave; if (unit == end_unit) break; + SELECT_LEX_NODE *save_slave= unit->slave; + next_unit= unit->next_unit(); unit->include_down(table->select_lex); unit->slave= save_slave; // fix include_down initialisation } |