Hello Dmitry!
I only have one minor comment about new version of your patch:
* Dmitry Shulga <Dmitry.Shulga@stripped> [11/05/16 14:21]:
> #At file:///Users/shulga/projects/mysql/mysql-5.1-bug11749345/ based on
> revid:tatjana.nuernberg@stripped
>
> 3620 Dmitry Shulga 2011-05-16
> Fixed bug#11749345 (formerly bug#38813) - increasing memory consumption
> when selecting from I_S and views exist, in SP.
>
...
> +
> +end:
> + lex->unit.cleanup();
> +
> + /*
> + For safety reset list of open temporary tables before closing
> + all tables open within this Open_tables_state.
> + */
> + thd->temporary_tables= 0;
> + close_thread_tables(thd);
> +
> + /* Restore original LEX value, statement's arena and THD arena values. */
> + lex_end(thd->lex);
> + thd->lex= old_lex;
> +
> + if (i_s_arena.free_list)
> + i_s_arena.free_items();
I think it is better to play it safe and move code which sets
THD::temporary_tables to 0 and closes tables here, after items
are freed. This way code in get_all_tables() will be consistent
with the way in which we do things in mysql_parse() function and
Prepared_statement::prepare() method.
...
Otherwise, I am OK with this patch and think that it can be
pushed once second reviewer approves.
--
Dmitry Lenev, Software Developer
Oracle Development SPB/MySQL, www.mysql.com
Are you MySQL certified? http://www.mysql.com/certification