MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:July 23 2009 1:29pm
Subject:Re: bzr commit into mysql-5.0-bugteam branch (gshchepa:2768) Bug#38816
View as plain text  
* Sergei Golubchik <serg@stripped> [09/07/23 17:10]:
> > >  2768 Gleb Shchepa	2009-06-11
> > >       Bug #38816: kill + flush tables with read lock + stored
> > >                   procedures causes crashes!

Gleb,

I agree with this Serg's comment.

> > === modified file 'sql/ha_innodb.cc'
> > --- sql/ha_innodb.cc	2009-06-25 09:50:26 +0000
> > +++ sql/ha_innodb.cc	2009-07-22 15:26:07 +0000
> > @@ -588,11 +588,11 @@ innobase_mysql_print_thd(
> >  	uint	max_query_len)	/* in: max query length to print, or 0 to
> >  				   use the default max length */
> >  {
> > -	const THD*	thd;
> > +	THD*		thd;
> >          const Security_context *sctx;
> >  	const char*	s;
> >  
> > -        thd = (const THD*) input_thd;
> > +        thd = (THD*) input_thd;
> >          /* We probably want to have original user as part of debug output. */
> >          sctx = &thd->main_security_ctx;
> >  
> > @@ -619,6 +619,7 @@ innobase_mysql_print_thd(
> >  		fputs(s, f);
> >  	}
> >  
> > +	VOID(pthread_mutex_lock(&thd->LOCK_thd_data));
> >  	if ((s = thd->query)) {
> >  		/* 3100 is chosen because currently 3000 is the maximum
> >  		   max_query_len we ever give this. */
> 
> minor comment - I've seen this first in Mats' patch - in principle
> locking the mutex inside THD doesn't change it, so it should be possible
> to lock it even if THD is declared const. C++ solution is the keyword
> "mutable":
> 
>  class THD {
>    ...
>    mutable pthread_mutex_t LOCK_thd_data;
>    ...
>  }
> 
> and you won't need to pretend that the object will be modified when you
> only want to read it under a mutex.

-- 
Thread
bzr commit into mysql-5.0-bugteam branch (gshchepa:2768) Bug#38816Gleb Shchepa11 Jun
  • Re: bzr commit into mysql-5.0-bugteam branch (gshchepa:2768) Bug#38816Konstantin Osipov23 Jul
    • Re: bzr commit into mysql-5.0-bugteam branch (gshchepa:2768)Bug#38816Sergei Golubchik23 Jul
      • Re: bzr commit into mysql-5.0-bugteam branch (gshchepa:2768) Bug#38816Konstantin Osipov23 Jul