List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:January 14 2011 11:03am
Subject:bzr push into mysql-5.1-telco-6.3 branch (jonas:3375 to 3376) Bug#59496
View as plain text  
 3376 Jonas Oreland	2011-01-14
      ndb - bug#59496 - check ALLOC-bit instead of op == ZINSERT

    modified:
      storage/ndb/src/kernel/blocks/ERROR_codes.txt
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
      storage/ndb/test/ndbapi/testBasic.cpp
      storage/ndb/test/run-test/daily-basic-tests.txt
 3375 Pekka Nousiainen	2011-01-03
      bug#58277 a08_fix5.diff
      signed vs unsigned warning

    modified:
      storage/ndb/test/ndbapi/testDict.cpp
=== modified file 'storage/ndb/src/kernel/blocks/ERROR_codes.txt'
--- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2010-12-02 18:10:25 +0000
+++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2011-01-14 11:02:20 +0000
@@ -6,7 +6,7 @@ Next DBTUP 4032
 Next DBLQH 5064
 Next DBDICT 6026
 Next DBDIH 7229
-Next DBTC 8088
+Next DBTC 8090
 Next CMVMI 9000
 Next BACKUP 10041
 Next DBUTIL 11002

=== modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2010-10-28 07:07:27 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2011-01-14 11:02:20 +0000
@@ -4624,7 +4624,11 @@ void Dbtc::commit020Lab(Signal* signal) 
 
     if (localTcConnectptr.i != RNIL) {
       Tcount = Tcount + 1;
-      if (Tcount < 16 && !ERROR_INSERTED(8057) && !ERROR_INSERTED(8073)) {
+      if (Tcount < 16 &&
+          ! (ERROR_INSERTED(8057) ||
+             ERROR_INSERTED(8073) ||
+             ERROR_INSERTED(8089)))
+      {
         ptrCheckGuard(localTcConnectptr,
                       TtcConnectFilesize, localTcConnectRecord);
         jam();
@@ -4646,6 +4650,11 @@ void Dbtc::commit020Lab(Signal* signal) 
         signal->theData[0] = TcContinueB::ZSEND_COMMIT_LOOP;
         signal->theData[1] = apiConnectptr.i;
         signal->theData[2] = localTcConnectptr.i;
+        if (ERROR_INSERTED(8089))
+        {
+          sendSignalWithDelay(cownref, GSN_CONTINUEB, signal, 100, 3);
+          return;
+        }
         sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
         return;
       }//if
@@ -4654,6 +4663,9 @@ void Dbtc::commit020Lab(Signal* signal) 
       if (ERROR_INSERTED(8057))
         CLEAR_ERROR_INSERT_VALUE;
 
+      if (ERROR_INSERTED(8089))
+        CLEAR_ERROR_INSERT_VALUE;
+
       regApiPtr->apiConnectstate = CS_COMMIT_SENT;
       return;
     }//if
@@ -6266,9 +6278,13 @@ ABORT020:
   if (tcConnectptr.p->nextTcConnect != RNIL) {
     jam();
     tcConnectptr.i = tcConnectptr.p->nextTcConnect;
-    if (TloopCount < 1024) {
+    if (TloopCount < 1024 && !
+        (ERROR_INSERTED(8089)))
+    {
       goto ABORT020;
-    } else {
+    }
+    else
+    {
       jam();
       /*---------------------------------------------------------------------
        * Reset timer to avoid time-out in real-time break.
@@ -6280,10 +6296,21 @@ ABORT020:
       signal->theData[0] = TcContinueB::ZABORT_BREAK;
       signal->theData[1] = tcConnectptr.i;
       signal->theData[2] = apiConnectptr.i;
+      if (ERROR_INSERTED(8089))
+      {
+        sendSignalWithDelay(cownref, GSN_CONTINUEB, signal, 100, 3);
+        return;
+      }
       sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
       return;
     }//if
   }//if
+
+  if (ERROR_INSERTED(8089))
+  {
+    CLEAR_ERROR_INSERT_VALUE;
+  }
+
   if (apiConnectptr.p->counter > 0) {
     jam();
     setApiConTimer(apiConnectptr.i, ctcTimer, __LINE__);

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2010-12-31 10:08:03 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2011-01-14 11:02:20 +0000
@@ -362,6 +362,7 @@ Dbtup::setup_read(KeyReqStruct *req_stru
 {
   OperationrecPtr currOpPtr;
   currOpPtr.i= req_struct->m_tuple_ptr->m_operation_ptr_i;
+  Uint32 bits = req_struct->m_tuple_ptr->m_header_bits;
   if (currOpPtr.i == RNIL)
   {
     if (regTabPtr->need_expand(disk))
@@ -394,8 +395,9 @@ Dbtup::setup_read(KeyReqStruct *req_stru
     
     Uint32 currOp= currOpPtr.p->op_struct.op_type;
     
+    bool is_insert = (bits & Tuple_header::ALLOC);
     if((found && currOp == ZDELETE) || 
-       ((dirty || !found) && currOp == ZINSERT))
+       ((dirty || !found) && is_insert))
     {
       terrorCode= ZTUPLE_DELETED_ERROR;
       break;

=== modified file 'storage/ndb/test/ndbapi/testBasic.cpp'
--- a/storage/ndb/test/ndbapi/testBasic.cpp	2010-08-31 06:28:52 +0000
+++ b/storage/ndb/test/ndbapi/testBasic.cpp	2011-01-14 11:02:20 +0000
@@ -2015,6 +2015,86 @@ runBug54944(NDBT_Context* ctx, NDBT_Step
   return NDBT_OK;
 }
 
+int
+runBug59496_scan(NDBT_Context* ctx, NDBT_Step* step)
+{
+  Ndb* pNdb = GETNDB(step);
+  const NdbDictionary::Table * pTab = ctx->getTab();
+  NdbRestarter res;
+  int rowcount = ctx->getProperty("CHECK_ROWCOUNT", Uint32(0));
+  int records = ctx->getNumRecords();
+  if (rowcount == 0)
+    records = 0;
+
+  HugoTransactions hugoTrans(*pTab);
+  while (!ctx->isTestStopped())
+  {
+    if (hugoTrans.scanReadRecords(pNdb,
+                                  records, 0, 0,
+                                  NdbOperation::LM_CommittedRead,
+                                  (int)NdbScanOperation::SF_TupScan) != NDBT_OK)
+      return NDBT_FAILED;
+  }
+  return NDBT_OK;
+}
+
+int
+runBug59496_case1(NDBT_Context* ctx, NDBT_Step* step)
+{
+  Ndb* pNdb = GETNDB(step);
+  NdbRestarter res;
+
+  int loops = ctx->getNumLoops();
+  int records = ctx->getNumRecords();
+
+  HugoOperations hugoOps(*ctx->getTab());
+  for (int i = 0; i < loops; i++)
+  {
+    hugoOps.startTransaction(pNdb);
+    hugoOps.pkInsertRecord(pNdb, 0, records, 0);
+    hugoOps.execute_NoCommit(pNdb);
+    hugoOps.pkUpdateRecord(pNdb, 0, records, rand());
+    hugoOps.execute_NoCommit(pNdb);
+    hugoOps.pkUpdateRecord(pNdb, 0, records, rand());
+    hugoOps.execute_NoCommit(pNdb);
+    res.insertErrorInAllNodes(8089);
+    hugoOps.execute_Commit(pNdb);
+    res.insertErrorInAllNodes(0);
+    hugoOps.closeTransaction(pNdb);
+    hugoOps.clearTable(pNdb);
+  }
+  ctx->stopTest();
+  return NDBT_OK;
+}
+
+int
+runBug59496_case2(NDBT_Context* ctx, NDBT_Step* step)
+{
+  Ndb* pNdb = GETNDB(step);
+  NdbRestarter res;
+
+  int loops = ctx->getNumLoops();
+  int records = ctx->getNumRecords();
+
+  HugoOperations hugoOps(*ctx->getTab());
+  for (int i = 0; i < loops; i++)
+  {
+    hugoOps.startTransaction(pNdb);
+    hugoOps.pkDeleteRecord(pNdb, 0, records);
+    hugoOps.execute_NoCommit(pNdb);
+    hugoOps.pkInsertRecord(pNdb, 0, records, 0);
+    hugoOps.execute_NoCommit(pNdb);
+
+    res.insertErrorInAllNodes(8089);
+    hugoOps.execute_Rollback(pNdb);
+    res.insertErrorInAllNodes(0);
+
+    hugoOps.closeTransaction(pNdb);
+  }
+  ctx->stopTest();
+  return NDBT_OK;
+}
+
 NDBT_TESTSUITE(testBasic);
 TESTCASE("PkInsert", 
 	 "Verify that we can insert and delete from this table using PK"
@@ -2328,6 +2408,18 @@ TESTCASE("Bug54944", "")
 {
   INITIALIZER(runBug54944);
 }
+TESTCASE("Bug59496_case1", "")
+{
+  STEP(runBug59496_case1);
+  STEPS(runBug59496_scan, 10);
+}
+TESTCASE("Bug59496_case2", "")
+{
+  TC_PROPERTY("CHECK_ROWCOUNT", 1);
+  INITIALIZER(runLoadTable);
+  STEP(runBug59496_case2);
+  STEPS(runBug59496_scan, 10);
+}
 NDBT_TESTSUITE_END(testBasic);
 
 #if 0

=== modified file 'storage/ndb/test/run-test/daily-basic-tests.txt'
--- a/storage/ndb/test/run-test/daily-basic-tests.txt	2011-01-03 11:02:42 +0000
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt	2011-01-14 11:02:20 +0000
@@ -255,6 +255,14 @@ max-time: 500
 cmd: testBasic
 args: -n Bug54944 T1
 
+max-time: 600
+cmd: testBasic
+args: -r 10 -n Bug59496_case1 T2
+
+max-time: 600
+cmd: testBasic
+args: -r 10 -n Bug59496_case2 T2
+
 #
 # INDEX
 #

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-6.3 branch (jonas:3375 to 3376) Bug#59496Jonas Oreland14 Jan