From: Dmitry Lenev Date: May 16 2011 1:25pm Subject: Re: bzr commit into mysql-5.1 branch (Dmitry.Shulga:3620) Bug#38813 Bug#11749345 List-Archive: http://lists.mysql.com/commits/137440 Message-Id: <20110516132509.GA10662@bandersnatch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hello Dmitry! I only have one minor comment about new version of your patch: * Dmitry Shulga [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