From: Dmitry Lenev Date: November 16 2010 9:41am Subject: Re: bzr commit into mysql-5.5-runtime branch (jon.hauglid:3185) Bug#57663 List-Archive: http://lists.mysql.com/commits/124003 Message-Id: <20101116094127.GF649@mockturtle> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hello Jon Olav! * Jon Olav Hauglid [10/11/15 21:23]: > #At file:///export/home/x/mysql-5.5-runtime-prereq/ based on revid:jon.hauglid@stripped > > 3185 Jon Olav Hauglid 2010-11-15 > Bug #57663 Concurrent statement using stored function and DROP DATABASE > breaks SBR > > This pre-requisite patch refactors the code for dropping tables, used > by DROP TABLE and DROP DATABASE. The patch moves the code for acquiring > metadata locks out of mysql_rm_table_part2() and makes it the > responsibility of the caller. This in preparation of changing the > DROP DATABASE implementation to acquire all metadata locks before any > changes are made. mysql_rm_table_part2() is renamed > mysql_rm_table_no_locks() to reflect the change. ... > === modified file 'sql/sql_table.cc' > --- a/sql/sql_table.cc 2010-11-12 11:23:17 +0000 > +++ b/sql/sql_table.cc 2010-11-15 18:13:30 +0000 > +/** > + Execute the drop of a normal or temporary table. > + > + @param thd Thread handler > + @param tables Tables to drop > + @param if_exists If set, don't give an error if table doesn't exists. > + In this case we give an warning of level 'NOTE' > + @param drop_temporary Only drop temporary tables > + @param drop_view Allow to delete VIEW .frm > + @param dont_log_query Don't write query to log files. This will also not > + generate warnings if the handler files doesn't exists > + > + @retval 0 ok > + @retval 1 Error > + @retval -1 Thread was killed > + > + @note This function assumes that metadata locks have already been taken. As discussed on IRC I think it also makes sense to mention that this function assumes that the tables have been removed from TDC. I am OK with your patch and think that it can be pushed after considering/addressing the above suggestion. -- Dmitry Lenev, Software Developer Oracle Development SPB/MySQL, www.mysql.com Are you MySQL certified? http://www.mysql.com/certification