List:Commits« Previous MessageNext Message »
From:jonas Date:January 23 2007 7:28pm
Subject:bk commit into 5.1 tree (jonas:1.2376) BUG#25794
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@stripped, 2007-01-23 19:27:55+01:00, jonas@eel.(none) +5 -0
  ndb - bug#25794
    Fix read after delete (in same op)
    - lqh, handling of attrinfo
    - tup, setup read for disk/varchar

  storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp@stripped, 2007-01-23 19:27:52+01:00,
jonas@eel.(none) +11 -8
    Dont save ATTRINFO "also" for DELETE, even when getting it in separate signal

  storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp@stripped, 2007-01-23 19:27:52+01:00,
jonas@eel.(none) +2 -1
    Add disk flag to signature
      (for read after delete)

  storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp@stripped, 2007-01-23 19:27:52+01:00,
jonas@eel.(none) +10 -4
    Do setup read before read after delete

  storage/ndb/test/ndbapi/testBasic.cpp@stripped, 2007-01-23 19:27:52+01:00, jonas@eel.(none)
+52 -0
    testcase

  storage/ndb/test/run-test/daily-basic-tests.txt@stripped, 2007-01-23 19:27:52+01:00,
jonas@eel.(none) +5 -1
    testcase

# 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:	jonas
# Host:	eel.(none)
# Root:	/home/jonas/src/51-work

--- 1.62/storage/ndb/test/run-test/daily-basic-tests.txt	2007-01-23 19:28:02 +01:00
+++ 1.63/storage/ndb/test/run-test/daily-basic-tests.txt	2007-01-23 19:28:02 +01:00
@@ -81,6 +81,10 @@
 
 max-time: 500
 cmd: testBasic
+args: -n DeleteRead
+
+max-time: 500
+cmd: testBasic
 args: -n PkReadAndLocker T6 D1 D2
 
 max-time: 500
@@ -461,7 +465,7 @@
 cmd: testScan
 args: -n Bug24447 T1
 
-max-time: 500
+max-time: 1000
 cmd: testScan
 args: -n ScanVariants
 

--- 1.130/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2007-01-23 19:28:02 +01:00
+++ 1.131/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2007-01-23 19:28:02 +01:00
@@ -3147,20 +3147,23 @@
 {
   TcConnectionrec * const regTcPtr = tcConnectptr.p;
   if (regTcPtr->operation != ZREAD) {
-    if (regTcPtr->opExec != 1) {
-      if (saveTupattrbuf(signal, dataPtr, length) == ZOK) {
-        ;
-      } else {
-        jam();
+    if (regTcPtr->operation != ZDELETE)
+    {
+      if (regTcPtr->opExec != 1) {
+	if (saveTupattrbuf(signal, dataPtr, length) == ZOK) {
+	  ;
+	} else {
+	  jam();
 /* ------------------------------------------------------------------------- */
 /* WE MIGHT BE WAITING FOR RESPONSE FROM SOME BLOCK HERE. THUS WE NEED TO    */
 /* GO THROUGH THE STATE MACHINE FOR THE OPERATION.                           */
 /* ------------------------------------------------------------------------- */
-        localAbortStateHandlerLab(signal);
-        return;
+	  localAbortStateHandlerLab(signal);
+	  return;
+	}//if
       }//if
     }//if
-  }//if
+  }
   c_tup->receive_attrinfo(signal, regTcPtr->tupConnectrec, dataPtr, length);
 }//Dblqh::lqhAttrinfoLab()
 

--- 1.54/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2007-01-23 19:28:02 +01:00
+++ 1.55/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2007-01-23 19:28:02 +01:00
@@ -1736,7 +1736,8 @@
                       Operationrec* regOperPtr,
                       Fragrecord* regFragPtr,
                       Tablerec* regTabPtr,
-                      KeyReqStruct* req_struct);
+                      KeyReqStruct* req_struct,
+		      bool disk);
 
 //------------------------------------------------------------------
 //------------------------------------------------------------------

--- 1.49/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2007-01-23 19:28:02 +01:00
+++ 1.50/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2007-01-23 19:28:02 +01:00
@@ -815,7 +815,9 @@
      {
        jam();
        if (handleDeleteReq(signal, regOperPtr,
-			   regFragPtr, regTabPtr, &req_struct) == -1) {
+			   regFragPtr, regTabPtr, 
+			   &req_struct,
+			   disk_page != RNIL) == -1) {
 	 return;
        }
        /*
@@ -1459,7 +1461,8 @@
                            Operationrec* regOperPtr,
                            Fragrecord* regFragPtr,
                            Tablerec* regTabPtr,
-                           KeyReqStruct *req_struct)
+                           KeyReqStruct *req_struct,
+			   bool disk)
 {
   // delete must set but not increment tupVersion
   if (!regOperPtr->is_first_operation())
@@ -1511,8 +1514,11 @@
   {
     return 0;
   }
-  
-  return handleReadReq(signal, regOperPtr, regTabPtr, req_struct);
+
+  if (setup_read(req_struct, regOperPtr, regFragPtr, regTabPtr, disk))
+  {
+    return handleReadReq(signal, regOperPtr, regTabPtr, req_struct);
+  }
 
 error:
   tupkeyErrorLab(signal);

--- 1.15/storage/ndb/test/ndbapi/testBasic.cpp	2007-01-23 19:28:02 +01:00
+++ 1.16/storage/ndb/test/ndbapi/testBasic.cpp	2007-01-23 19:28:02 +01:00
@@ -1273,6 +1273,52 @@
   return NDBT_OK;
 }
 
+int
+runDeleteRead(NDBT_Context* ctx, NDBT_Step* step){
+  
+  Ndb* pNdb = GETNDB(step);
+
+  const NdbDictionary::Table* tab = ctx->getTab();
+  NDBT_ResultRow row(*ctx->getTab());
+  HugoTransactions tmp(*ctx->getTab());
+
+  int a;
+  int loops = ctx->getNumLoops();
+  const int rows = ctx->getNumRecords();
+  
+  while (loops--)
+  {
+    NdbTransaction* pTrans = pNdb->startTransaction();
+    NdbOperation* pOp = pTrans->getNdbOperation(tab->getName());
+    pOp->deleteTuple();
+    for(a = 0; a<tab->getNoOfColumns(); a++)
+    {
+      if (tab->getColumn(a)->getPrimaryKey() == true)
+      {
+	if(tmp.equalForAttr(pOp, a, 0) != 0)
+	{
+	  ERR(pTrans->getNdbError());
+	  return NDBT_FAILED;
+	}
+      }
+    }
+    
+    // Define attributes to read  
+    for(a = 0; a<tab->getNoOfColumns(); a++)
+    {
+      if((row.attributeStore(a) = pOp->getValue(tab->getColumn(a)->getName()))
== 0) {
+	ERR(pTrans->getNdbError());
+	return NDBT_FAILED;
+      }
+    }
+
+    pTrans->execute(Commit);
+    pTrans->close();
+  }
+  
+  return NDBT_OK;
+}
+
 NDBT_TESTSUITE(testBasic);
 TESTCASE("PkInsert", 
 	 "Verify that we can insert and delete from this table using PK"
@@ -1542,6 +1588,12 @@
 TESTCASE("Bug25090", 
 	 "Verify what happens when we fill the db" ){
   STEP(runBug25090);
+}
+TESTCASE("DeleteRead", 
+	 "Verify Delete+Read" ){
+  INITIALIZER(runLoadTable);
+  INITIALIZER(runDeleteRead);
+  FINALIZER(runClearTable2);
 }
 NDBT_TESTSUITE_END(testBasic);
 
Thread
bk commit into 5.1 tree (jonas:1.2376) BUG#25794jonas23 Jan