1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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)


sql/sql_view.cc:
  Fix for BUG#10107: In mysql_make_view, when joining subquery lists, take into account 
  that both lists can have length > 1 (see also fix for BUG#8490)
This commit is contained in:
unknown
2005-04-23 06:55:43 +04:00
parent 8d44b2d3d7
commit 1bfb107050

View File

@@ -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
}