List:Internals« Previous MessageNext Message »
From:jonas.oreland Date:July 22 2005 1:29pm
Subject:bk commit into 5.1 tree (joreland:1.1865)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1865 05/07/22 15:29:49 joreland@stripped +5 -0
  Merge joreland@stripped:/home/bk/mysql-5.1
  into  mysql.com:/home/jonas/src/mysql-5.1-push

  storage/ndb/test/src/HugoOperations.cpp
    1.24 05/07/22 15:29:42 joreland@stripped +0 -0
    Auto merged

  storage/ndb/test/ndbapi/testNdbApi.cpp
    1.21 05/07/22 15:29:42 joreland@stripped +0 -0
    Auto merged

  storage/ndb/test/include/HugoOperations.hpp
    1.16 05/07/22 15:29:42 joreland@stripped +0 -0
    Auto merged

  storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
    1.57 05/07/22 15:29:42 joreland@stripped +0 -0
    Auto merged

  storage/ndb/src/kernel/blocks/backup/Backup.cpp
    1.22 05/07/22 15:29:42 joreland@stripped +0 -0
    Auto merged

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	joreland
# Host:	eel.(none)
# Root:	/home/jonas/src/mysql-5.1-push/RESYNC

--- 1.21/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2005-07-22 15:27:07 +02:00
+++ 1.22/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2005-07-22 15:29:42 +02:00
@@ -2858,8 +2858,6 @@
   /**
    * Initialize table object
    */
-  tabPtr.p->frag_mask = RNIL;
-
   tabPtr.p->schemaVersion = tmpTab.TableVersion;
   tabPtr.p->noOfAttributes = tmpTab.NoOfAttributes;
   tabPtr.p->noOfNull = 0;
@@ -2952,7 +2950,6 @@
   ndbrequire(findTable(ptr, tabPtr, tableId));
   
   ndbrequire(tabPtr.p->fragments.seize(fragCount) != false);
-  tabPtr.p->frag_mask = calculate_frag_mask(fragCount);
   for(Uint32 i = 0; i<fragCount; i++) {
     jam();
     FragmentPtr fragPtr;
@@ -3769,15 +3766,6 @@
  * Slave functionallity: Perform logging
  *
  ****************************************************************************/
-Uint32
-Backup::calculate_frag_mask(Uint32 count)
-{
-  Uint32 mask = 1;
-  while (mask < count) mask <<= 1;
-  mask -= 1;
-  return mask;
-}
-
 void
 Backup::execBACKUP_TRIG_REQ(Signal* signal)
 {
@@ -3794,14 +3782,6 @@
   jamEntry();
   c_triggerPool.getPtr(trigPtr, trigger_id);
   c_tablePool.getPtr(tabPtr, trigPtr.p->tab_ptr_i);
-  frag_id = frag_id & tabPtr.p->frag_mask;
-  /*
-  At the moment the fragment identity known by TUP is the
-  actual fragment id but with possibly an extra bit set.
-  This is due to that ACC splits the fragment. Thus fragment id 5 can
-  here be either 5 or 13. Thus masking with 2 ** n - 1 where number of
-  fragments <= 2 ** n will always provide a correct fragment id.
-  */
   tabPtr.p->fragments.getPtr(fragPtr, frag_id);
   if (fragPtr.p->node != getOwnNodeId()) {
     jam();

--- 1.56/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp	2005-07-22 15:27:07 +02:00
+++ 1.57/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp	2005-07-22 15:29:42 +02:00
@@ -4849,16 +4849,16 @@
   else if(operationRecPtr.p->operation == ZWRITE)
   {
     jam();
-    operationRecPtr.p->operation = ZINSERT;
+    operationRecPtr.p->operation = ZUPDATE;
     if (operationRecPtr.p->prevParallelQue != RNIL) {
       OperationrecPtr prevOpPtr;
       jam();
       prevOpPtr.i = operationRecPtr.p->prevParallelQue;
       ptrCheckGuard(prevOpPtr, coprecsize, operationrec);
-      if (prevOpPtr.p->operation != ZDELETE) 
+      if (prevOpPtr.p->operation == ZDELETE) 
       {
         jam();
-        operationRecPtr.p->operation = ZUPDATE;
+        operationRecPtr.p->operation = ZINSERT;
       }
     }
   }

--- 1.15/storage/ndb/test/include/HugoOperations.hpp	2005-07-22 15:27:09 +02:00
+++ 1.16/storage/ndb/test/include/HugoOperations.hpp	2005-07-22 15:29:42 +02:00
@@ -45,6 +45,10 @@
 		    int recordNo,
 		    int numRecords = 1,
 		    int updatesValue = 0);
+
+  int pkWritePartialRecord(Ndb*,
+			   int recordNo,
+			   int numRecords = 1);
   
   int pkReadRecord(Ndb*,
 		   int recordNo,

--- 1.20/storage/ndb/test/ndbapi/testNdbApi.cpp	2005-07-22 15:27:09 +02:00
+++ 1.21/storage/ndb/test/ndbapi/testNdbApi.cpp	2005-07-22 15:29:42 +02:00
@@ -1037,7 +1037,7 @@
   return result;
 }
 
-#define C2(x) { int _x= (x); if(_x == 0) return NDBT_FAILED; }
+#define C2(x) { int _x= (x); if(_x == 0){ ndbout << "line: " << __LINE__ << endl;  return NDBT_FAILED;} }
 
 int runBug_11133(NDBT_Context* ctx, NDBT_Step* step){
   int result = NDBT_OK;
@@ -1046,7 +1046,6 @@
   HugoOperations hugoOps(*pTab);
 
   Ndb* pNdb = GETNDB(step);
-
   C2(hugoOps.startTransaction(pNdb) == 0);
   C2(hugoOps.pkInsertRecord(pNdb, 0, 1) == 0);
   C2(hugoOps.execute_NoCommit(pNdb) == 0);
@@ -1098,7 +1097,7 @@
   C2(hugoOps.pkInsertRecord(pNdb, 0, 1) == 0);
   C2(hugoOps.execute_NoCommit(pNdb) == 0);
   C2(hugoOps2.startTransaction(&ndb2) == 0);
-  C2(hugoOps2.pkWriteRecord(&ndb2, 0, 1) == 0);
+  C2(hugoOps2.pkWritePartialRecord(&ndb2, 0) == 0);
   C2(hugoOps2.execute_async(&ndb2, NdbTransaction::NoCommit) == 0);
   C2(hugoOps.execute_Commit(pNdb) == 0);
   C2(hugoOps2.wait_async(&ndb2) == 0);
@@ -1113,6 +1112,29 @@
   C2(hugoOps2.execute_async(&ndb2, NdbTransaction::NoCommit) == 0);
   C2(hugoOps.execute_Commit(pNdb) == 0);
   C2(hugoOps2.wait_async(&ndb2) == 0);
+  C2(hugoOps2.execute_Commit(pNdb) == 0);
+  C2(hugoOps.closeTransaction(pNdb) == 0);
+  C2(hugoOps2.closeTransaction(&ndb2) == 0);  
+
+  C2(hugoOps.startTransaction(pNdb) == 0);
+  C2(hugoOps.pkUpdateRecord(pNdb, 0, 1) == 0);
+  C2(hugoOps.execute_NoCommit(pNdb) == 0);
+  C2(hugoOps2.startTransaction(&ndb2) == 0);
+  C2(hugoOps2.pkWritePartialRecord(&ndb2, 0) == 0);
+  C2(hugoOps2.execute_async(&ndb2, NdbTransaction::NoCommit) == 0);
+  C2(hugoOps.execute_Commit(pNdb) == 0);
+  C2(hugoOps2.wait_async(&ndb2) == 0);
+  C2(hugoOps.closeTransaction(pNdb) == 0);
+  C2(hugoOps2.closeTransaction(&ndb2) == 0);  
+
+  C2(hugoOps.startTransaction(pNdb) == 0);
+  C2(hugoOps.pkDeleteRecord(pNdb, 0, 1) == 0);
+  C2(hugoOps.execute_NoCommit(pNdb) == 0);
+  C2(hugoOps2.startTransaction(&ndb2) == 0);
+  C2(hugoOps2.pkWritePartialRecord(&ndb2, 0) == 0);
+  C2(hugoOps2.execute_async(&ndb2, NdbTransaction::NoCommit) == 0);
+  C2(hugoOps.execute_Commit(pNdb) == 0);
+  C2(hugoOps2.wait_async(&ndb2) != 0);
   C2(hugoOps.closeTransaction(pNdb) == 0);
   C2(hugoOps2.closeTransaction(&ndb2) == 0);  
 

--- 1.23/storage/ndb/test/src/HugoOperations.cpp	2005-07-22 15:27:09 +02:00
+++ 1.24/storage/ndb/test/src/HugoOperations.cpp	2005-07-22 15:29:42 +02:00
@@ -267,6 +267,37 @@
   return NDBT_OK;
 }
 
+int HugoOperations::pkWritePartialRecord(Ndb* pNdb,
+					 int recordNo,
+					 int numRecords){
+  
+  int a, check;
+  for(int r=0; r < numRecords; r++){
+    NdbOperation* pOp = pTrans->getNdbOperation(tab.getName());	
+    if (pOp == NULL) {
+      ERR(pTrans->getNdbError());
+      return NDBT_FAILED;
+    }
+    
+    check = pOp->writeTuple();
+    if( check == -1 ) {
+      ERR(pTrans->getNdbError());
+      return NDBT_FAILED;
+    }
+    
+    // Define primary keys
+    for(a = 0; a<tab.getNoOfColumns(); a++){
+      if (tab.getColumn(a)->getPrimaryKey() == true){
+	if(equalForAttr(pOp, a, r+recordNo) != 0){
+	  ERR(pTrans->getNdbError());
+	  return NDBT_FAILED;
+	}
+      }
+    }
+  }
+  return NDBT_OK;
+}
+
 int HugoOperations::pkDeleteRecord(Ndb* pNdb,
 				   int recordNo,
 				   int numRecords){
@@ -419,7 +450,14 @@
 {
   assert(pCon == pTrans);
   m_async_reply= 1;
-  m_async_return= res;
+  if(res)
+  {
+    m_async_return = pCon->getNdbError().code;
+  }
+  else
+  {
+    m_async_return = 0;
+  }
 }
 
 int 
@@ -444,6 +482,8 @@
 
   if(m_async_reply)
   {
+    if(m_async_return)
+      ndbout << "ERROR: " << pNdb->getNdbError(m_async_return) << endl;
     return m_async_return;
   }
   ndbout_c("wait returned nothing...");
Thread
bk commit into 5.1 tree (joreland:1.1865)jonas.oreland22 Jul