List:Commits« Previous MessageNext Message »
From:Frazer Clement Date:June 2 2010 8:43am
Subject:Re: bzr commit into mysql-5.1-telco-6.2 branch (jonas:3101) Bug#54168
View as plain text  
Good find.
Would be good to modify CMVMI fragmented tests to check for this, and a 
comment on the SaveSignal<> class to indicate the use-case.

Jonas Oreland wrote:
> #At file:///home/jonas/src/telco-6.2/ based on
> revid:jonas@stripped
> 
>  3101 Jonas Oreland	2010-06-02
>       ndb - bug#54168 - fix so that sendFragmented doesnt tamper with
> signal->theData
> 
>     modified:
>       storage/ndb/src/kernel/vm/SimulatedBlock.cpp
>       storage/ndb/src/kernel/vm/VMSignal.hpp
> === modified file 'storage/ndb/src/kernel/vm/SimulatedBlock.cpp'
> --- a/storage/ndb/src/kernel/vm/SimulatedBlock.cpp	2009-10-09 09:13:43 +0000
> +++ b/storage/ndb/src/kernel/vm/SimulatedBlock.cpp	2010-06-02 07:27:05 +0000
> @@ -1973,7 +1973,9 @@ SimulatedBlock::sendFragmentedSignal(Blo
>    }
>    ptr.p->m_callback = c;
>  
> -  if(!c_fragSenderRunning){
> +  if(!c_fragSenderRunning)
> +  {
> +    SaveSignal<2> save(signal);
>      c_fragSenderRunning = true;
>      ContinueFragmented * sig = (ContinueFragmented*)signal->getDataPtrSend();
>      sig->type = ContinueFragmented::CONTINUE_SENDING;
> @@ -2012,7 +2014,9 @@ SimulatedBlock::sendFragmentedSignal(Nod
>    }
>    ptr.p->m_callback = c;
>  
> -  if(!c_fragSenderRunning){
> +  if(!c_fragSenderRunning)
> +  {
> +    SaveSignal<2> save(signal);
>      c_fragSenderRunning = true;
>      ContinueFragmented * sig = (ContinueFragmented*)signal->getDataPtrSend();
>      sig->type = ContinueFragmented::CONTINUE_SENDING;
> @@ -2062,7 +2066,9 @@ SimulatedBlock::sendFragmentedSignal(Blo
>    }
>    tmp.p->m_callback = c;
>    
> -  if(!c_fragSenderRunning){
> +  if(!c_fragSenderRunning)
> +  {
> +    SaveSignal<2> save(signal);
>      c_fragSenderRunning = true;
>      ContinueFragmented * sig = (ContinueFragmented*)signal->getDataPtrSend();
>      sig->type = ContinueFragmented::CONTINUE_SENDING;
> @@ -2105,7 +2111,9 @@ SimulatedBlock::sendFragmentedSignal(Nod
>    }
>    tmp.p->m_callback = c;
>    
> -  if(!c_fragSenderRunning){
> +  if(!c_fragSenderRunning)
> +  {
> +    SaveSignal<2> save(signal);
>      c_fragSenderRunning = true;
>      ContinueFragmented * sig = (ContinueFragmented*)signal->getDataPtrSend();
>      sig->type = ContinueFragmented::CONTINUE_SENDING;
> 
> === modified file 'storage/ndb/src/kernel/vm/VMSignal.hpp'
> --- a/storage/ndb/src/kernel/vm/VMSignal.hpp	2009-05-26 18:53:34 +0000
> +++ b/storage/ndb/src/kernel/vm/VMSignal.hpp	2010-06-02 07:27:05 +0000
> @@ -104,6 +104,37 @@ public:
>    void garbage_register();
>  };
>  
> +template<Uint32 len>
> +class SaveSignal 
> +{
> +  Uint32 m_copy[len];
> +  Signal * m_signal;
> +
> +public:
> +  SaveSignal(Signal* signal) {
> +    save(signal);
> +  }
> +
> +  void save(Signal* signal) {
> +    m_signal = signal;
> +    for (Uint32 i = 0; i<len; i++)
> +      m_copy[i] = m_signal->theData[i];
> +  }
> +
> +  void clear() { m_signal = 0;}
> +
> +  void restore() {
> +    for (Uint32 i = 0; i<len; i++)
> +      m_signal->theData[i] = m_copy[i];
> +  }
> +
> +  ~SaveSignal() {
> +    if (m_signal)
> +      restore();
> +    clear();
> +  }
> +};
> +
>  inline
>  Uint32
>  Signal::getLength() const {
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 


-- 
Frazer Clement, Software Engineer,
MySQL Cluster / Oracle - www.mysql.com
Office: Edinburgh, UK

Are you MySQL certified?  www.mysql.com/certification
Thread
bzr commit into mysql-5.1-telco-6.2 branch (jonas:3101) Bug#54168Jonas Oreland2 Jun
  • Re: bzr commit into mysql-5.1-telco-6.2 branch (jonas:3101) Bug#54168Frazer Clement2 Jun