List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:February 9 2011 1:16pm
Subject:bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (jonas:3423)
View as plain text  
#At file:///home/jonas/src/70-spj-svs/ based on revid:jonas@stripped

 3423 Jonas Oreland	2011-02-09
      ndb spj - remove added member variable NdbReceiver::m_query_operation_impl
        which is a duplicate of m_owner (albeit type-safe).
      
        changing sizeof(NdbReceiver) also changes sizeof(NdbOperation)
          which could be safe...i don't want to check...

    modified:
      storage/ndb/include/ndbapi/NdbReceiver.hpp
      storage/ndb/src/ndbapi/NdbImpl.hpp
      storage/ndb/src/ndbapi/NdbQueryOperation.cpp
      storage/ndb/src/ndbapi/NdbReceiver.cpp
      storage/ndb/src/ndbapi/NdbTransaction.cpp
      storage/ndb/src/ndbapi/NdbTransactionScan.cpp
      storage/ndb/src/ndbapi/Ndbif.cpp
=== modified file 'storage/ndb/include/ndbapi/NdbReceiver.hpp'
--- a/storage/ndb/include/ndbapi/NdbReceiver.hpp	2011-02-09 11:40:01 +0000
+++ b/storage/ndb/include/ndbapi/NdbReceiver.hpp	2011-02-09 13:15:56 +0000
@@ -58,7 +58,7 @@ public:
                           NDB_QUERY_OPERATION = 4
   };
   
-  NdbReceiver(Ndb *aNdb, NdbQueryOperationImpl* queryOpImpl=0);
+  NdbReceiver(Ndb *aNdb);
   int init(ReceiverType type, bool useRec, void* owner);
   void release();
   ~NdbReceiver();
@@ -209,11 +209,7 @@ private:
    */
   Uint32 m_expected_result_length;
   Uint32 m_received_result_length;
-  /** If non-NULL, certain signals should be handled by the 
-   * NdbQueryOperationImpl object. The signals are TRANSID_AI, 
-   * SCAN_TABCONF, TCKEYREF and TCKEYCONF.*/
-  NdbQueryOperationImpl* const m_query_operation_impl;
-  
+
   bool hasResults() const { return m_result_rows > 0; }
   bool nextResult() const { return m_current_row < m_result_rows; }
   NdbRecAttr* copyout(NdbReceiver&);

=== modified file 'storage/ndb/src/ndbapi/NdbImpl.hpp'
--- a/storage/ndb/src/ndbapi/NdbImpl.hpp	2011-02-08 14:29:52 +0000
+++ b/storage/ndb/src/ndbapi/NdbImpl.hpp	2011-02-09 13:15:56 +0000
@@ -265,7 +265,7 @@ NdbReceiver::getTransaction() const {
     assert(false);
     return NULL;
   case NDB_QUERY_OPERATION:
-    return &m_query_operation_impl->getQuery().getNdbTransaction();
+    return &((NdbQueryOperationImpl*)m_owner)->getQuery().getNdbTransaction();
   default:
     return ((NdbOperation*)m_owner)->theNdbCon;
   }

=== modified file 'storage/ndb/src/ndbapi/NdbQueryOperation.cpp'
--- a/storage/ndb/src/ndbapi/NdbQueryOperation.cpp	2011-02-08 12:14:41 +0000
+++ b/storage/ndb/src/ndbapi/NdbQueryOperation.cpp	2011-02-09 13:15:56 +0000
@@ -477,7 +477,7 @@ private:
 
 NdbResultStream::NdbResultStream(NdbQueryOperationImpl& operation, Uint32 rootFragNo):
   m_rootFragNo(rootFragNo),
-  m_receiver(operation.getQuery().getNdbTransaction().getNdb(), &operation),
+  m_receiver(operation.getQuery().getNdbTransaction().getNdb()),
   m_maxRows(0),
   m_rowCount(0),
   m_operation(operation),

=== modified file 'storage/ndb/src/ndbapi/NdbReceiver.cpp'
--- a/storage/ndb/src/ndbapi/NdbReceiver.cpp	2011-02-04 11:45:24 +0000
+++ b/storage/ndb/src/ndbapi/NdbReceiver.cpp	2011-02-09 13:15:56 +0000
@@ -20,7 +20,7 @@
 #include <signaldata/TcKeyConf.hpp>
 #include <signaldata/DictTabInfo.hpp>
 
-NdbReceiver::NdbReceiver(Ndb *aNdb, NdbQueryOperationImpl* queryOpImpl) :
+NdbReceiver::NdbReceiver(Ndb *aNdb) :
   theMagicNumber(0),
   m_ndb(aNdb),
   m_id(NdbObjectIdMap::InvalidId),
@@ -32,9 +32,8 @@ NdbReceiver::NdbReceiver(Ndb *aNdb, NdbQ
   theCurrentRecAttr(NULL),
   m_rows(NULL),
   m_current_row(0xffffffff),
-  m_result_rows(0),
+  m_result_rows(0)
 //m_defined_rows(0),
-  m_query_operation_impl(queryOpImpl)
 {}
  
 NdbReceiver::~NdbReceiver()
@@ -50,8 +49,6 @@ NdbReceiver::~NdbReceiver()
 int
 NdbReceiver::init(ReceiverType type, bool useRec, void* owner)
 {
-  assert((type==NDB_QUERY_OPERATION && m_query_operation_impl!=NULL)
-         || (type!=NDB_QUERY_OPERATION && m_query_operation_impl==NULL));
   theMagicNumber = 0x11223344;
   m_type = type;
   m_using_ndb_record= useRec;
@@ -889,7 +886,8 @@ NdbReceiver::setErrorCode(int code)
 {
   theMagicNumber = 0;
   if(getType()==NDB_QUERY_OPERATION){
-    m_query_operation_impl->getQuery().setErrorCode(code);
+    NdbQueryOperationImpl* op = (NdbQueryOperationImpl*)getOwner();
+    op->getQuery().setErrorCode(code);
   }else{
     NdbOperation* const op = (NdbOperation*)getOwner();
     assert(op->checkMagicNumber()==0);

=== modified file 'storage/ndb/src/ndbapi/NdbTransaction.cpp'
--- a/storage/ndb/src/ndbapi/NdbTransaction.cpp	2011-02-08 14:29:52 +0000
+++ b/storage/ndb/src/ndbapi/NdbTransaction.cpp	2011-02-09 13:15:56 +0000
@@ -2116,7 +2116,8 @@ from other transactions.
         Uint32 done;
         if(tReceiver->getType()==NdbReceiver::NDB_QUERY_OPERATION){ 
           /* This signal is part of a linked operation.*/
-          done = tReceiver->m_query_operation_impl->getQuery().execTCKEYCONF();
+          done = ((NdbQueryOperationImpl*)(tReceiver->m_owner))
+            ->getQuery().execTCKEYCONF();
         }else{
           done = tReceiver->execTCOPCONF(tAttrInfoLen);
         }

=== modified file 'storage/ndb/src/ndbapi/NdbTransactionScan.cpp'
--- a/storage/ndb/src/ndbapi/NdbTransactionScan.cpp	2011-02-04 11:45:24 +0000
+++ b/storage/ndb/src/ndbapi/NdbTransactionScan.cpp	2011-02-09 13:15:56 +0000
@@ -131,7 +131,7 @@ NdbTransaction::receiveSCAN_TABCONF(cons
         // Check if this is a linked operation.
         if (tOp->getType()==NdbReceiver::NDB_QUERY_OPERATION)
         {
-          NdbQueryOperationImpl* queryOp = tOp->m_query_operation_impl;
+          NdbQueryOperationImpl* queryOp = (NdbQueryOperationImpl*)tOp->m_owner;
           assert (&queryOp->getQuery() == m_scanningQuery);
 
           if (queryOp->execSCAN_TABCONF(tcPtrI, opCount, totalLen, tOp))

=== modified file 'storage/ndb/src/ndbapi/Ndbif.cpp'
--- a/storage/ndb/src/ndbapi/Ndbif.cpp	2011-02-08 14:29:52 +0000
+++ b/storage/ndb/src/ndbapi/Ndbif.cpp	2011-02-09 13:15:56 +0000
@@ -376,7 +376,7 @@ Ndb::handleReceivedSignal(const NdbApiSi
 	Uint32 com;
 	if(aSignal->m_noOfSections > 0){
 	  if(tRec->getType()==NdbReceiver::NDB_QUERY_OPERATION){
-	    com = tRec->m_query_operation_impl
+	    com = ((NdbQueryOperationImpl*)(tRec->m_owner))
               ->execTRANSID_AI(ptr[0].p, ptr[0].sz);
 	  }else{
 	    com = tRec->execTRANSID_AI(ptr[0].p, ptr[0].sz);
@@ -409,8 +409,10 @@ Ndb::handleReceivedSignal(const NdbApiSi
                      (Uint32) NO_WAIT : tWaitState);
 	  break;
         case NdbReceiver::NDB_QUERY_OPERATION:
+        {
           // Handled differently whether it is a scan or lookup
-          if (tRec->m_query_operation_impl->getQueryDef().isScanQuery()) {
+          NdbQueryOperationImpl* tmp = (NdbQueryOperationImpl*)(tRec->m_owner);
+          if (tmp->getQueryDef().isScanQuery()) {
             tNewState = (((WaitSignalType) tWaitState) == WAIT_SCAN ? 
                        (Uint32) NO_WAIT : tWaitState);
             break;
@@ -420,6 +422,7 @@ Ndb::handleReceivedSignal(const NdbApiSi
             }
             return;
           }
+        }
 	default:
 	  goto InvalidSignal;
 	}
@@ -507,7 +510,9 @@ Ndb::handleReceivedSignal(const NdbApiSi
       if (tCon != NULL) {
         if (tCon->theSendStatus == NdbTransaction::sendTC_OP) {
           if (receiver->getType()==NdbReceiver::NDB_QUERY_OPERATION) {
-            if (receiver->m_query_operation_impl->execTCKEYREF(aSignal) &&
+            NdbQueryOperationImpl* tmp =
+              (NdbQueryOperationImpl*)(receiver->m_owner);
+            if (tmp->execTCKEYREF(aSignal) &&
                tCon->OpCompleteFailure() != -1) {
               completedTransaction(tCon);
               return;


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20110209131556-kg3k6hsvpw2fs5un.bundle
Thread
bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (jonas:3423) Jonas Oreland9 Feb