List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:October 4 2010 7:46pm
Subject:bzr push into mysql-5.1-telco-7.1 branch (jonas:3864 to 3865)
View as plain text  
 3865 Jonas Oreland	2010-10-04 [merge]
      ndb - merge 70 to 71

    modified:
      storage/ndb/include/ndbapi/Ndb.hpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
      storage/ndb/src/ndbapi/NdbScanOperation.cpp
      storage/ndb/src/ndbapi/Ndbif.cpp
      storage/ndb/src/ndbapi/TransporterFacade.cpp
      storage/ndb/src/ndbapi/TransporterFacade.hpp
 3864 Jonas Oreland	2010-10-04 [merge]
      ndb - merge 70 to 71

    modified:
      storage/ndb/include/kernel/signaldata/ScanFrag.hpp
      storage/ndb/include/ndb_version.h.in
      storage/ndb/src/common/debugger/signaldata/ScanTab.cpp
      storage/ndb/src/kernel/blocks/backup/Backup.cpp
      storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
      storage/ndb/src/kernel/blocks/suma/Suma.cpp
      storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
=== modified file 'storage/ndb/include/ndbapi/Ndb.hpp'
--- a/storage/ndb/include/ndbapi/Ndb.hpp	2010-10-01 10:08:29 +0000
+++ b/storage/ndb/include/ndbapi/Ndb.hpp	2010-10-04 19:38:02 +0000
@@ -1072,6 +1072,7 @@ class Ndb
   friend class Ndb_cluster_connection_impl;
   friend class Ndb_internal;
   friend class NdbScanFilterImpl;
+  friend class PollGuard;
 #endif
 
 public:

=== modified file 'storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp'
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2010-10-01 10:08:29 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2010-10-04 19:38:02 +0000
@@ -1985,25 +1985,12 @@ NdbDictionaryImpl::getBlobTable(uint tab
   DBUG_RETURN(bt);
 }
 
-#if 0
-bool
-NdbDictionaryImpl::setTransporter(class TransporterFacade * tf)
-{
-  if(tf != 0){
-    m_globalHash = tf->m_globalDictCache;
-    return m_receiver.setTransporter(tf);
-  }
-  
-  return false;
-}
-#endif
-
 bool
 NdbDictionaryImpl::setTransporter(class Ndb* ndb, 
 				  class TransporterFacade * tf)
 {
   m_globalHash = tf->m_globalDictCache;
-  if(m_receiver.setTransporter(ndb, tf)){
+  if(m_receiver.setTransporter(ndb)){
     return true;
   }
   return false;
@@ -2030,46 +2017,19 @@ NdbDictionaryImpl::getIndexTable(NdbInde
   return index_table;
 }
 
-#if 0
-bool
-NdbDictInterface::setTransporter(class TransporterFacade * tf)
-{
-  if(tf == 0)
-    return false;
-  
-  Guard g(tf->theMutexPtr);
-  
-  m_blockNumber = tf->open(this,
-			   execSignal,
-			   execNodeStatus);
-  
-  if ( m_blockNumber == -1 ) {
-    m_error.code= 4105;
-    return false; // no more free blocknumbers
-  }//if
-  Uint32 theNode = tf->ownId();
-  m_reference = numberToRef(m_blockNumber, theNode);
-  m_transporter = tf;
-  m_waiter.m_mutex = tf->theMutexPtr;
-
-  return true;
-}
-#endif
-
 bool
-NdbDictInterface::setTransporter(class Ndb* ndb, class TransporterFacade * tf)
+NdbDictInterface::setTransporter(class Ndb* ndb)
 {
   m_reference = ndb->getReference();
-  m_transporter = tf;
-  m_waiter.m_mutex = tf->theMutexPtr;
+  m_impl = ndb->theImpl;
   
   return true;
 }
 
 TransporterFacade *
-NdbDictInterface::getTransporter()
+NdbDictInterface::getTransporter() const
 {
-  return m_transporter;
+  return m_impl->m_transporter_facade;
 }
 
 NdbDictInterface::~NdbDictInterface()
@@ -2212,7 +2172,7 @@ NdbDictInterface::execNodeStatus(void* d
   
   switch(event){
   case NS_NODE_FAILED:
-    tmp->m_waiter.nodeFail(aNode);
+    tmp->m_impl->theWaiter.nodeFail(aNode);
     break;
   default:
     break;
@@ -2261,15 +2221,15 @@ NdbDictInterface::dictSignal(NdbApiSigna
       in all places where the object is out of context due to a return,
       break, continue or simply end of statement block
     */
-    PollGuard poll_guard(m_transporter, &m_waiter, refToBlock(m_reference));
+    PollGuard poll_guard(* m_impl);
     Uint32 node;
     switch(node_specification){
     case 0:
-      node = (m_transporter->get_node_alive(m_masterNodeId) ? m_masterNodeId :
-	      (m_masterNodeId = m_transporter->get_an_alive_node()));
+      node = (getTransporter()->get_node_alive(m_masterNodeId) ? m_masterNodeId :
+	      (m_masterNodeId = getTransporter()->get_an_alive_node()));
       break;
     case -1:
-      node = m_transporter->get_an_alive_node();
+      node = getTransporter()->get_an_alive_node();
       break;
     default:
       node = node_specification;
@@ -2280,8 +2240,8 @@ NdbDictInterface::dictSignal(NdbApiSigna
       DBUG_RETURN(-1);
     }
     int res = (ptr ? 
-	       m_transporter->sendFragmentedSignal(sig, node, ptr, secs):
-	       m_transporter->sendSignal(sig, node));
+	       getTransporter()->sendFragmentedSignal(sig, node, ptr, secs):
+	       getTransporter()->sendSignal(sig, node));
     if(res != 0){
       DBUG_PRINT("info", ("dictSignal failed to send signal"));
       m_error.code = 4007;
@@ -2305,7 +2265,7 @@ NdbDictInterface::dictSignal(NdbApiSigna
       m_error.code = 4013;
       continue;
     }
-    if(m_waiter.m_state == WST_WAIT_TIMEOUT)
+    if(m_impl->theWaiter.m_state == WST_WAIT_TIMEOUT)
     {
       DBUG_PRINT("info", ("dictSignal caught time-out"));
       m_error.code = 4008;
@@ -2497,7 +2457,7 @@ end:
     return;
   }  
   
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
@@ -2518,7 +2478,7 @@ NdbDictInterface::execGET_TABINFO_REF(co
     m_error.code = (*(signal->getDataPtr() + 
                       GetTabInfoRef::OriginalErrorOffset));
   }
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 /*****************************************************************
@@ -3676,7 +3636,7 @@ NdbDictInterface::execCREATE_TABLE_CONF(
   Uint32* data = (Uint32*)m_buffer.get_data();
   data[0] = conf->tableId;
   data[1] = conf->tableVersion;
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
@@ -3686,14 +3646,14 @@ NdbDictInterface::execCREATE_TABLE_REF(c
   const CreateTableRef* ref = CAST_CONSTPTR(CreateTableRef, sig->getDataPtr());
   m_error.code= ref->errorCode;
   m_masterNodeId = ref->masterNodeId;
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
 NdbDictInterface::execALTER_TABLE_CONF(const NdbApiSignal * signal,
                                        const LinearSectionPtr ptr[3])
 {
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
@@ -3703,7 +3663,7 @@ NdbDictInterface::execALTER_TABLE_REF(co
   const AlterTableRef * ref = CAST_CONSTPTR(AlterTableRef, sig->getDataPtr());
   m_error.code= ref->errorCode;
   m_masterNodeId = ref->masterNodeId;
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 /*****************************************************************
@@ -3899,7 +3859,7 @@ NdbDictInterface::execDROP_TABLE_CONF(co
   DBUG_ENTER("NdbDictInterface::execDROP_TABLE_CONF");
   //DropTableConf* const conf = CAST_CONSTPTR(DropTableConf, signal->getDataPtr());
 
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
   DBUG_VOID_RETURN;
 }
 
@@ -3911,7 +3871,7 @@ NdbDictInterface::execDROP_TABLE_REF(con
   const DropTableRef* ref = CAST_CONSTPTR(DropTableRef, signal->getDataPtr());
   m_error.code= ref->errorCode;
   m_masterNodeId = ref->masterNodeId;
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
   DBUG_VOID_RETURN;
 }
 
@@ -4157,7 +4117,7 @@ void
 NdbDictInterface::execCREATE_INDX_CONF(const NdbApiSignal * signal,
 				       const LinearSectionPtr ptr[3])
 {
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
@@ -4168,7 +4128,7 @@ NdbDictInterface::execCREATE_INDX_REF(co
   m_error.code = ref->errorCode;
   if (m_error.code == ref->NotMaster)
     m_masterNodeId = ref->masterNodeId;
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 /*****************************************************************
@@ -4293,7 +4253,7 @@ void
 NdbDictInterface::execDROP_INDX_CONF(const NdbApiSignal * signal,
 				       const LinearSectionPtr ptr[3])
 {
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
@@ -4304,7 +4264,7 @@ NdbDictInterface::execDROP_INDX_REF(cons
   m_error.code = ref->errorCode;
   if (m_error.code == ref->NotMaster)
     m_masterNodeId = ref->masterNodeId;
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 /*****************************************************************
@@ -4811,7 +4771,7 @@ NdbDictInterface::execCREATE_EVNT_CONF(c
   DBUG_PRINT("info",("nodeid=%d,subscriptionId=%d,subscriptionKey=%d",
 		     refToNode(signal->theSendersBlockRef),
 		     subscriptionId,subscriptionKey));
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
   DBUG_VOID_RETURN;
 }
 
@@ -4828,7 +4788,7 @@ NdbDictInterface::execCREATE_EVNT_REF(co
 		      ref->getErrorLine(),ref->getErrorNode()));
   if (m_error.code == CreateEvntRef::NotMaster)
     m_masterNodeId = ref->getMasterNode();
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
   DBUG_VOID_RETURN;
 }
 
@@ -4860,7 +4820,7 @@ NdbDictInterface::execSUB_STOP_CONF(cons
   data[0] = gci_hi;
   data[1] = gci_lo;
 
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
   DBUG_VOID_RETURN;
 }
 
@@ -4884,7 +4844,7 @@ NdbDictInterface::execSUB_STOP_REF(const
   {
     m_masterNodeId = subStopRef->m_masterNodeId;
   }
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
   DBUG_VOID_RETURN;
 }
 
@@ -4933,7 +4893,7 @@ NdbDictInterface::execSUB_START_CONF(con
   }
   DBUG_PRINT("info",("subscriptionId=%d,subscriptionKey=%d,subscriberData=%d",
 		     subscriptionId,subscriptionKey,subscriberData));
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
   DBUG_VOID_RETURN;
 }
 
@@ -4947,7 +4907,7 @@ NdbDictInterface::execSUB_START_REF(cons
   m_error.code= subStartRef->errorCode;
   if (m_error.code == SubStartRef::NotMaster)
     m_masterNodeId = subStartRef->m_masterNodeId;
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
   DBUG_VOID_RETURN;
 }
 
@@ -5083,7 +5043,7 @@ NdbDictInterface::execDROP_EVNT_CONF(con
 				     const LinearSectionPtr ptr[3])
 {
   DBUG_ENTER("NdbDictInterface::execDROP_EVNT_CONF");
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
   DBUG_VOID_RETURN;
 }
 
@@ -5100,7 +5060,7 @@ NdbDictInterface::execDROP_EVNT_REF(cons
 	     ref->getErrorCode(), ref->getErrorLine(), ref->getErrorNode()));
   if (m_error.code == DropEvntRef::NotMaster)
     m_masterNodeId = ref->getMasterNode();
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
   DBUG_VOID_RETURN;
 }
 
@@ -5633,13 +5593,13 @@ NdbDictInterface::listObjects(NdbApiSign
       in all places where the object is out of context due to a return,
       break, continue or simply end of statement block
     */
-    PollGuard poll_guard(m_transporter, &m_waiter, refToBlock(m_reference));
-    Uint16 aNodeId = m_transporter->get_an_alive_node();
+    PollGuard poll_guard(* m_impl);
+    Uint16 aNodeId = getTransporter()->get_an_alive_node();
     if (aNodeId == 0) {
       m_error.code= 4009;
       return -1;
     }
-    NodeInfo info = m_transporter->theClusterMgr->getNodeInfo(aNodeId).m_info;
+    NodeInfo info = getTransporter()->theClusterMgr->getNodeInfo(aNodeId).m_info;
     if (ndbd_LIST_TABLES_CONF_long_signal(info.m_version))
     {
       /*
@@ -5657,7 +5617,7 @@ NdbDictInterface::listObjects(NdbApiSign
       return -1;
     }
 
-    if (m_transporter->sendSignal(signal, aNodeId) != 0) {
+    if (getTransporter()->sendSignal(signal, aNodeId) != 0) {
       continue;
     }
     m_error.code= 0;
@@ -5679,7 +5639,7 @@ NdbDictInterface::execLIST_TABLES_CONF(c
                                        const LinearSectionPtr ptr[3])
 {
   Uint16 nodeId = refToNode(signal->theSendersBlockRef);
-  NodeInfo info = m_transporter->theClusterMgr->getNodeInfo(nodeId).m_info;
+  NodeInfo info = getTransporter()->theClusterMgr->getNodeInfo(nodeId).m_info;
   if (!ndbd_LIST_TABLES_CONF_long_signal(info.m_version))
   {
     /*
@@ -5748,7 +5708,7 @@ NdbDictInterface::execLIST_TABLES_CONF(c
     return;
   }
 
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 
@@ -5764,7 +5724,7 @@ NdbDictInterface::execOLD_LIST_TABLES_CO
   }
   if (signal->getLength() < OldListTablesConf::SignalLength) {
     // last signal has less than full length
-    m_waiter.signal(NO_WAIT);
+    m_impl->theWaiter.signal(NO_WAIT);
   }
 }
 
@@ -5794,23 +5754,23 @@ NdbDictInterface::forceGCPWait(int type)
     const Uint32 RETRIES = 100;
     for (Uint32 i = 0; i < RETRIES; i++)
     {
-      m_transporter->lock_mutex();
-      Uint16 aNodeId = m_transporter->get_an_alive_node();
+      getTransporter()->lock_mutex();
+      Uint16 aNodeId = getTransporter()->get_an_alive_node();
       if (aNodeId == 0) {
         m_error.code= 4009;
-        m_transporter->unlock_mutex();
+        getTransporter()->unlock_mutex();
         return -1;
       }
-      if (m_transporter->sendSignal(&tSignal, aNodeId) != 0) {
-        m_transporter->unlock_mutex();
+      if (getTransporter()->sendSignal(&tSignal, aNodeId) != 0) {
+        getTransporter()->unlock_mutex();
         continue;
       }
 
       m_error.code= 0;
-      m_waiter.m_node = aNodeId;
-      m_waiter.m_state = WAIT_LIST_TABLES_CONF;
-      m_waiter.wait(DICT_WAITFOR_TIMEOUT);
-      m_transporter->unlock_mutex();
+      m_impl->theWaiter.m_node = aNodeId;
+      m_impl->theWaiter.m_state = WAIT_LIST_TABLES_CONF;
+      m_impl->theWaiter.wait(DICT_WAITFOR_TIMEOUT);
+      getTransporter()->unlock_mutex();
       return m_error.code == 0 ? 0 : -1;
     }
     return -1;
@@ -5825,20 +5785,20 @@ NdbDictInterface::forceGCPWait(int type)
     const Uint32 RETRIES = 100;
     for (Uint32 i = 0; i < RETRIES; i++)
     {
-      m_transporter->lock_mutex();
-      Uint16 aNodeId = m_transporter->get_an_alive_node();
+      getTransporter()->lock_mutex();
+      Uint16 aNodeId = getTransporter()->get_an_alive_node();
       if (aNodeId == 0) {
         m_error.code= 4009;
-        m_transporter->unlock_mutex();
+        getTransporter()->unlock_mutex();
         return -1;
       }
-      if (m_transporter->sendSignal(&tSignal, aNodeId) != 0) {
-        m_transporter->unlock_mutex();
+      if (getTransporter()->sendSignal(&tSignal, aNodeId) != 0) {
+        getTransporter()->unlock_mutex();
         continue;
       }
 
-      m_transporter->forceSend(refToBlock(m_reference));
-      m_transporter->unlock_mutex();
+      getTransporter()->forceSend(refToBlock(m_reference));
+      getTransporter()->unlock_mutex();
     }
     return m_error.code == 0 ? 0 : -1;
   }
@@ -5868,7 +5828,7 @@ NdbDictInterface::execWAIT_GCP_CONF(cons
 
   m_data.m_wait_gcp_conf.gci_lo = conf->gci_lo;
   m_data.m_wait_gcp_conf.gci_hi = conf->gci_hi;
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
@@ -5878,7 +5838,7 @@ NdbDictInterface::execWAIT_GCP_REF(const
   const WaitGCPRef* ref = CAST_CONSTPTR(WaitGCPRef, signal->getDataPtr());
   m_error.code = ref->errorCode;
 
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 NdbFilegroupImpl::NdbFilegroupImpl(NdbDictionary::Object::Type t)
@@ -7276,7 +7236,7 @@ NdbDictInterface::execCREATE_FILE_CONF(c
   data[1] = conf->fileVersion;
   data[2] = conf->warningFlags;
   
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
@@ -7287,7 +7247,7 @@ NdbDictInterface::execCREATE_FILE_REF(co
     CAST_CONSTPTR(CreateFileRef, signal->getDataPtr());
   m_error.code = ref->errorCode;
   m_masterNodeId = ref->masterNodeId;
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 int
@@ -7321,7 +7281,7 @@ void
 NdbDictInterface::execDROP_FILE_CONF(const NdbApiSignal * signal,
 					    const LinearSectionPtr ptr[3])
 {
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
@@ -7332,7 +7292,7 @@ NdbDictInterface::execDROP_FILE_REF(cons
     CAST_CONSTPTR(DropFileRef, signal->getDataPtr());
   m_error.code = ref->errorCode;
   m_masterNodeId = ref->masterNodeId;
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 int
@@ -7444,7 +7404,7 @@ NdbDictInterface::execCREATE_FILEGROUP_C
   data[0] = conf->filegroupId;
   data[1] = conf->filegroupVersion;
   data[2] = conf->warningFlags;
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);  
 }
 
 void
@@ -7455,7 +7415,7 @@ NdbDictInterface::execCREATE_FILEGROUP_R
     CAST_CONSTPTR(CreateFilegroupRef, signal->getDataPtr());
   m_error.code = ref->errorCode;
   m_masterNodeId = ref->masterNodeId;
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 int
@@ -7489,7 +7449,7 @@ void
 NdbDictInterface::execDROP_FILEGROUP_CONF(const NdbApiSignal * signal,
 					    const LinearSectionPtr ptr[3])
 {
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
@@ -7500,7 +7460,7 @@ NdbDictInterface::execDROP_FILEGROUP_REF
     CAST_CONSTPTR(DropFilegroupRef, signal->getDataPtr());
   m_error.code = ref->errorCode;
   m_masterNodeId = ref->masterNodeId;
-  m_waiter.signal(NO_WAIT);  
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 
@@ -8024,7 +7984,7 @@ NdbDictInterface::execCREATE_HASH_MAP_RE
     CAST_CONSTPTR(CreateHashMapRef, signal->getDataPtr());
   m_error.code = ref->errorCode;
   m_masterNodeId = ref->masterNodeId;
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 
@@ -8039,7 +7999,7 @@ NdbDictInterface::execCREATE_HASH_MAP_CO
   data[0] = conf->objectId;
   data[1] = conf->objectVersion;
 
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 
@@ -8153,9 +8113,9 @@ NdbDictInterface::checkAllNodeVersionsMi
 {
   for (Uint32 nodeId = 1; nodeId < MAX_NODES; nodeId++)
   {
-    if (m_transporter->getIsDbNode(nodeId) &&
-        m_transporter->getIsNodeSendable(nodeId) &&
-        (m_transporter->getNodeNdbVersion(nodeId) <
+    if (getTransporter()->getIsDbNode(nodeId) &&
+        getTransporter()->getIsNodeSendable(nodeId) &&
+        (getTransporter()->getNodeNdbVersion(nodeId) <
          minNdbVersion))
     {
       /* At least 1 sendable data node has lower-than-min
@@ -8248,7 +8208,7 @@ NdbDictInterface::execSCHEMA_TRANS_BEGIN
     CAST_CONSTPTR(SchemaTransBeginConf, signal->getDataPtr());
   assert(m_tx.m_transId == conf->transId);
   m_tx.m_transKey = conf->transKey;
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
@@ -8259,7 +8219,7 @@ NdbDictInterface::execSCHEMA_TRANS_BEGIN
     CAST_CONSTPTR(SchemaTransBeginRef, signal->getDataPtr());
   m_error.code = ref->errorCode;
   m_masterNodeId = ref->masterNodeId;
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
@@ -8269,7 +8229,7 @@ NdbDictInterface::execSCHEMA_TRANS_END_C
   const SchemaTransEndConf* conf=
     CAST_CONSTPTR(SchemaTransEndConf, signal->getDataPtr());
   assert(m_tx.m_transId == conf->transId);
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
@@ -8281,7 +8241,7 @@ NdbDictInterface::execSCHEMA_TRANS_END_R
   m_error.code = ref->errorCode;
   m_tx.m_error.code = ref->errorCode;
   m_masterNodeId = ref->masterNodeId;
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 void
@@ -8296,7 +8256,7 @@ NdbDictInterface::execSCHEMA_TRANS_END_R
     m_tx.m_state = Tx::Aborted;
   m_tx.m_error.code = rep->errorCode;
   m_masterNodeId = rep->masterNodeId;
-  m_waiter.signal(NO_WAIT);
+  m_impl->theWaiter.signal(NO_WAIT);
 }
 
 const NdbDictionary::Column * NdbDictionary::Column::FRAGMENT = 0;

=== modified file 'storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp'
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp	2010-10-01 10:08:29 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp	2010-10-04 19:22:21 +0000
@@ -31,9 +31,9 @@
 #include <Bitmask.hpp>
 #include <AttributeList.hpp>
 #include <Ndb.hpp>
-#include "NdbWaiter.hpp"
 #include "DictCache.hpp"
 #include <signaldata/DictSignal.hpp>
+#include "NdbWaiter.hpp"
 
 class ListTablesReq;
 
@@ -601,13 +601,12 @@ public:
     m_tx(tx), m_error(err), m_warn(warn) {
     m_reference = 0;
     m_masterNodeId = 0;
-    m_transporter= NULL;
+    m_impl = 0;
   }
   ~NdbDictInterface();
   
-  bool setTransporter(class Ndb * ndb, class TransporterFacade * tf);
-  bool setTransporter(class TransporterFacade * tf);
-  class TransporterFacade *getTransporter();
+  bool setTransporter(class Ndb * ndb);
+  class TransporterFacade *getTransporter() const;
   
   // To abstract the stuff thats made in all create/drop/lists below
   int dictSignal(NdbApiSignal* signal, LinearSectionPtr ptr[3], int secs,
@@ -708,9 +707,8 @@ public:
 private:
   Uint32 m_reference;
   Uint32 m_masterNodeId;
-  
-  NdbWaiter m_waiter;
-  class TransporterFacade * m_transporter;
+
+  class NdbImpl * m_impl;
   
   friend class Ndb;
   friend class NdbImpl;

=== modified file 'storage/ndb/src/ndbapi/NdbScanOperation.cpp'
--- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2010-09-30 10:36:47 +0000
+++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2010-10-04 19:38:02 +0000
@@ -1837,8 +1837,7 @@ NdbScanOperation::nextResultNdbRecord(co
     The rest needs to be done under mutex due to synchronization with receiver
     thread.
   */
-  PollGuard poll_guard(tp, &theNdb->theImpl->theWaiter,
-                       theNdb->theNdbBlockNumber);
+  PollGuard poll_guard(* theNdb->theImpl);
 
   const Uint32 seq= theNdbCon->theNodeSequence;
 
@@ -2037,8 +2036,7 @@ void NdbScanOperation::close(bool forceS
       in all places where the object is out of context due to a return,
       break, continue or simply end of statement block
     */
-    PollGuard poll_guard(tp, &theNdb->theImpl->theWaiter,
-                         theNdb->theNdbBlockNumber);
+    PollGuard poll_guard(* theNdb->theImpl);
     close_impl(tp, forceSend, &poll_guard);
   }
 
@@ -3712,8 +3710,7 @@ NdbIndexScanOperation::ordered_send_scan
   Uint32 timeout= theNdb->theImpl->get_waitfor_timeout();
   TransporterFacade* tp= theNdb->theImpl->m_transporter_facade;
 
-  PollGuard poll_guard(tp, &theNdb->theImpl->theWaiter,
-                       theNdb->theNdbBlockNumber);
+  PollGuard poll_guard(* theNdb->theImpl);
   if(theError.code)
     return -1;
 

=== modified file 'storage/ndb/src/ndbapi/Ndbif.cpp'
--- a/storage/ndb/src/ndbapi/Ndbif.cpp	2010-10-01 10:08:29 +0000
+++ b/storage/ndb/src/ndbapi/Ndbif.cpp	2010-10-04 19:38:02 +0000
@@ -1307,8 +1307,7 @@ Ndb::sendPollNdb(int aMillisecondNumber,
     in all places where the object is out of context due to a return,
     break, continue or simply end of statement block
   */
-  PollGuard pg(theImpl->m_transporter_facade, &theImpl->theWaiter,
-               theNdbBlockNumber);
+  PollGuard pg(* theImpl);
   sendPrepTrans(forceSend);
   return poll_trans(aMillisecondNumber, minNoOfEventsToWakeup, &pg);
 }
@@ -1351,8 +1350,7 @@ Ndb::pollNdb(int aMillisecondNumber, int
     in all places where the object is out of context due to a return,
     break, continue or simply end of statement block
   */
-  PollGuard pg(theImpl->m_transporter_facade, &theImpl->theWaiter,
-               theNdbBlockNumber);
+  PollGuard pg(* theImpl);
   return poll_trans(aMillisecondNumber, minNoOfEventsToWakeup, &pg);
 }
 
@@ -1384,7 +1382,7 @@ Ndb::sendRecSignal(Uint16 node_id,
     in all places where the object is out of context due to a return,
     break, continue or simply end of statement block
   */
-  PollGuard poll_guard(tp,&theImpl->theWaiter,theNdbBlockNumber);
+  PollGuard poll_guard(* theImpl);
   read_conn_seq= tp->getNodeSequence(node_id);
   if (ret_conn_seq)
     *ret_conn_seq= read_conn_seq;

=== modified file 'storage/ndb/src/ndbapi/TransporterFacade.cpp'
--- a/storage/ndb/src/ndbapi/TransporterFacade.cpp	2010-10-01 11:43:32 +0000
+++ b/storage/ndb/src/ndbapi/TransporterFacade.cpp	2010-10-04 19:38:02 +0000
@@ -1639,14 +1639,15 @@ TransporterFacade::get_active_ndb_object
   return m_threads.m_use_cnt;
 }
 
-PollGuard::PollGuard(TransporterFacade *tp, NdbWaiter *aWaiter,
-                     Uint32 block_no)
+#include "NdbImpl.hpp"
+
+PollGuard::PollGuard(NdbImpl& impl)
 {
-  m_tp= tp;
-  m_waiter= aWaiter;
+  m_tp= impl.m_transporter_facade;
+  m_waiter= &impl.theWaiter;
   m_locked= true;
-  m_block_no= block_no;
-  tp->lock_mutex();
+  m_block_no= impl.m_ndb.theNdbBlockNumber;
+  m_tp->lock_mutex();
 }
 
 /*

=== modified file 'storage/ndb/src/ndbapi/TransporterFacade.hpp'
--- a/storage/ndb/src/ndbapi/TransporterFacade.hpp	2010-10-01 11:43:32 +0000
+++ b/storage/ndb/src/ndbapi/TransporterFacade.hpp	2010-10-04 19:38:02 +0000
@@ -297,7 +297,7 @@ public:
 class PollGuard
 {
   public:
-  PollGuard(TransporterFacade *tp, NdbWaiter *aWaiter, Uint32 block_no);
+  PollGuard(NdbImpl&);
   ~PollGuard() { unlock_and_signal(); }
   int wait_n_unlock(int wait_time, NodeId nodeId, Uint32 state,
                     bool forceSend= false);


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20101004194527-ym31qdk8s77z3204.bundle
Thread
bzr push into mysql-5.1-telco-7.1 branch (jonas:3864 to 3865) Jonas Oreland5 Oct