List:Commits« Previous MessageNext Message »
From:jonas oreland Date:February 15 2011 10:52am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (jonas:4193)
View as plain text  
#At file:///home/jonas/src/telco-7.0/ based on revid:jonas@stripped

 4193 jonas oreland	2011-02-15
      ndb - add signal data struct for TcSchVer req/conf

    modified:
      storage/ndb/include/kernel/signaldata/CreateTab.hpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
=== modified file 'storage/ndb/include/kernel/signaldata/CreateTab.hpp'
--- a/storage/ndb/include/kernel/signaldata/CreateTab.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/kernel/signaldata/CreateTab.hpp	2011-02-15 10:52:32 +0000
@@ -78,4 +78,29 @@ struct CreateTabRef {
   Uint32 errorStatus;
 };
 
+/**
+ * TcSchVerReq is CreateTab but towards TC...
+ *   should be removed in favor of CreateTab
+ */
+struct TcSchVerReq
+{
+  Uint32 tableId;
+  Uint32 tableVersion;
+  Uint32 tableLogged;
+  Uint32 senderRef;
+  Uint32 tableType;
+  Uint32 senderData;
+  Uint32 noOfPrimaryKeys;
+  Uint32 singleUserMode;
+  Uint32 userDefinedPartition;
+  STATIC_CONST( SignalLength = 9 );
+};
+
+struct TcSchVerConf
+{
+  Uint32 senderRef;
+  Uint32 senderData;
+  STATIC_CONST( SignalLength = 2 );
+};
+
 #endif

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2011-02-04 09:26:51 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2011-02-15 10:52:32 +0000
@@ -6751,25 +6751,27 @@ Dbdict::execTAB_COMMITCONF(Signal* signa
   if (refToBlock(signal->getSendersBlockRef()) == DBLQH) {
     jam();
     // prepare table in DBTC
-    signal->theData[0] = tabPtr.i;
-    signal->theData[1] = tabPtr.p->tableVersion;
-    signal->theData[2] = (Uint32)!!(tabPtr.p->m_bits & TableRecord::TR_Logged);
-    signal->theData[3] = reference();
-    signal->theData[4] = (Uint32)tabPtr.p->tableType;
-    signal->theData[5] = op_ptr.p->op_key;
-    signal->theData[6] = (Uint32)tabPtr.p->noOfPrimkey;
-    signal->theData[7] = (Uint32)tabPtr.p->singleUserMode;
-    signal->theData[8] = (tabPtr.p->fragmentType == DictTabInfo::UserDefined);
+    TcSchVerReq * req = (TcSchVerReq*)signal->getDataPtr();
+    req->tableId = tabPtr.i;
+    req->tableVersion = tabPtr.p->tableVersion;
+    req->tableLogged = (Uint32)!!(tabPtr.p->m_bits & TableRecord::TR_Logged);
+    req->senderRef = reference();
+    req->tableType = (Uint32)tabPtr.p->tableType;
+    req->senderData = op_ptr.p->op_key;
+    req->noOfPrimaryKeys = (Uint32)tabPtr.p->noOfPrimkey;
+    req->singleUserMode = (Uint32)tabPtr.p->singleUserMode;
+    req->userDefinedPartition = (tabPtr.p->fragmentType == DictTabInfo::UserDefined);
 
     if (DictTabInfo::isOrderedIndex(tabPtr.p->tableType))
     {
       jam();
       TableRecordPtr basePtr;
       c_tableRecordPool.getPtr(basePtr, tabPtr.p->primaryTableId);
-      signal->theData[8] =(basePtr.p->fragmentType == DictTabInfo::UserDefined);
+      req->userDefinedPartition = (basePtr.p->fragmentType == DictTabInfo::UserDefined);
     }
 
-    sendSignal(DBTC_REF, GSN_TC_SCHVERREQ, signal, 9, JBB);
+    sendSignal(DBTC_REF, GSN_TC_SCHVERREQ, signal,
+               TcSchVerReq::SignalLength, JBB);
     return;
   }
 

=== modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2011-01-31 17:37:07 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2011-02-15 10:52:32 +0000
@@ -86,7 +86,7 @@
 
 #include <signaldata/DbinfoScan.hpp>
 #include <signaldata/TransIdAI.hpp>
-
+#include <signaldata/CreateTab.hpp>
 
 // Use DEBUG to print messages that should be
 // seen only when we debug the product
@@ -391,17 +391,18 @@ void Dbtc::execTC_SCHVERREQ(Signal* sign
     jam();
     return;
   }
-  tabptr.i = signal->theData[0];
+  const TcSchVerReq* req = CAST_CONSTPTR(TcSchVerReq, signal->getDataPtr());
+  tabptr.i = req->tableId;
   ptrCheckGuard(tabptr, ctabrecFilesize, tableRecord);
-  tabptr.p->currentSchemaVersion = signal->theData[1];
+  tabptr.p->currentSchemaVersion = req->tableVersion;
   tabptr.p->m_flags = 0;
-  tabptr.p->set_storedTable((bool)signal->theData[2]);
-  BlockReference retRef = signal->theData[3];
-  tabptr.p->tableType = (Uint8)signal->theData[4];
-  BlockReference retPtr = signal->theData[5];
-  Uint32 noOfKeyAttr = signal->theData[6];
-  tabptr.p->singleUserMode = (Uint8)signal->theData[7];
-  Uint32 userDefinedPartitioning = (Uint8)signal->theData[8];
+  tabptr.p->set_storedTable((bool)req->tableLogged);
+  BlockReference retRef = req->senderRef;
+  tabptr.p->tableType = (Uint8)req->tableType;
+  BlockReference retPtr = req->senderData;
+  Uint32 noOfKeyAttr = req->noOfPrimaryKeys;
+  tabptr.p->singleUserMode = (Uint8)req->singleUserMode;
+  Uint32 userDefinedPartitioning = (Uint8)req->userDefinedPartition;
   ndbrequire(noOfKeyAttr <= MAX_ATTRIBUTES_IN_INDEX);
 
   const KeyDescriptor* desc = g_key_descriptor_pool.getPtr(tabptr.i);
@@ -418,9 +419,11 @@ void Dbtc::execTC_SCHVERREQ(Signal* sign
   tabptr.p->hasVarKeys = desc->noOfVarKeys > 0;
   tabptr.p->set_user_defined_partitioning(userDefinedPartitioning);
 
-  signal->theData[0] = tabptr.i;
-  signal->theData[1] = retPtr;
-  sendSignal(retRef, GSN_TC_SCHVERCONF, signal, 2, JBB);
+  TcSchVerConf * conf = (TcSchVerConf*)signal->getDataPtr();
+  conf->senderRef = reference();
+  conf->senderData = retPtr;
+  sendSignal(retRef, GSN_TC_SCHVERCONF, signal,
+             TcSchVerConf::SignalLength, JBB);
 }//Dbtc::execTC_SCHVERREQ()
 
 // create table commit


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20110215105232-3hmorgqzxsgkgax6.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (jonas:4193) jonas oreland15 Feb