On 01/28/2011 02:37 PM, Tor Didriksen wrote:
> 3563 Tor Didriksen 2011-01-28
> Bug #59794 Enable unit testing of classes which depend on a working THD
Patch approved, with two requests for expanded comments.
> Large parts of the codebase depend on a THD instance in order to be tested.
> The THD needs to be modified, so it can be used in unit tests.
> Some global initialization also needs to be done.
I think this comment could be expanded to list the changes made in this
patch to enable THD testing and why they were needed for unit testing.
> === modified file 'sql/sql_plugin.cc'
> --- a/sql/sql_plugin.cc 2010-12-06 13:12:51 +0000
> +++ b/sql/sql_plugin.cc 2011-01-28 13:37:15 +0000
> @@ -1039,6 +1039,9 @@ void plugin_unlock_list(THD *thd, plugin
> LEX *lex= thd ? thd->lex : 0;
> + if (count == 0)
> + DBUG_VOID_RETURN;
Maybe add a short comment here explaining that the reason for the early
return is that LOCK_plugin might not be initialized?
--- Jon Olav