List:Commits« Previous MessageNext Message »
From:pekka Date:January 28 2008 1:03pm
Subject:bk commit into 5.1 tree (pekka:1.2664) BUG#31477
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of pekka.  When pekka 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, 2008-01-28 13:03:27+01:00, pekka@stripped +3 -0
  ndb - bug#31477 post-merge fixes in 5.1

  storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp@stripped, 2008-01-28 13:02:17+01:00,
pekka@stripped +4 -5
    bug#31477 post-merge fixes in 5.1

  storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp@stripped, 2008-01-28 13:02:17+01:00,
pekka@stripped +1 -15
    bug#31477 post-merge fixes in 5.1

  storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp@stripped, 2008-01-28 13:02:18+01:00,
pekka@stripped +40 -22
    bug#31477 post-merge fixes in 5.1

diff -Nrup a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2008-01-28 03:06:59 +01:00
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2008-01-28 13:02:17 +01:00
@@ -1558,7 +1558,7 @@ public:
   /*
    * TUX checks if tuple is visible to scan.
    */
-  bool tuxQueryTh(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tupVersion,
Uint32 transId1, Uint32 transId2, bool dirty, Uint32 savePointId);
+  bool tuxQueryTh(Uint32 fragPtrI, Uint32 pageId, Uint32 pageIndex, Uint32 tupVersion,
Uint32 transId1, Uint32 transId2, bool dirty, Uint32 savepointId);
 
   int load_diskpage(Signal*, Uint32 opRec, Uint32 fragPtrI, 
 		    Uint32 local_key, Uint32 flags);
@@ -3041,16 +3041,15 @@ inline
 bool Dbtup::find_savepoint(OperationrecPtr& loopOpPtr, Uint32 savepointId)
 {
   while (true) {
-    if (savepointId > loopOpPtr.p->savePointId) {
+    if (savepointId > loopOpPtr.p->savepointId) {
       jam();
       return true;
     }
-    // note 5.0 has reversed next/prev pointers
-    loopOpPtr.i = loopOpPtr.p->nextActiveOp;
+    loopOpPtr.i = loopOpPtr.p->prevActiveOp;
     if (loopOpPtr.i == RNIL) {
       break;
     }
-    ptrCheckGuard(loopOpPtr, cnoOfOprec, operationrec);
+    c_operation_pool.getPtr(loopOpPtr);
   }
   return false;
 }
diff -Nrup a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2007-11-01 08:29:59 +01:00
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2008-01-28 13:02:17 +01:00
@@ -358,21 +358,7 @@ Dbtup::setup_read(KeyReqStruct *req_stru
       dirty= false;
     }
 
-    OperationrecPtr prevOpPtr = currOpPtr;  
-    bool found= false;
-    while(true) 
-    {
-      if (savepointId > currOpPtr.p->savepointId) {
-	found= true;
-	break;
-      }
-      if (currOpPtr.p->is_first_operation()){
-	break;
-      }
-      prevOpPtr= currOpPtr;
-      currOpPtr.i = currOpPtr.p->prevActiveOp;
-      c_operation_pool.getPtr(currOpPtr);
-    }
+    bool found= find_savepoint(currOpPtr, savepointId);
     
     Uint32 currOp= currOpPtr.p->op_struct.op_type;
     
diff -Nrup a/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp
b/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp	2008-01-28 03:14:12 +01:00
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp	2008-01-28 13:02:18 +01:00
@@ -15,6 +15,7 @@
 
 #define DBTUP_C
 #define DBTUP_INDEX_CPP
+#include <Dblqh.hpp>
 #include "Dbtup.hpp"
 #include <RefConvert.hpp>
 #include <ndb_limits.h>
@@ -330,7 +331,14 @@ Dbtup::accReadPk(Uint32 tableId, Uint32 
  * clear to do the full check here.
  */
 bool
-Dbtup::tuxQueryTh(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tupVersion,
Uint32 transId1, Uint32 transId2, bool dirty, Uint32 savePointId)
+Dbtup::tuxQueryTh(Uint32 fragPtrI,
+                  Uint32 pageId,
+                  Uint32 pageIndex,
+                  Uint32 tupVersion,
+                  Uint32 transId1,
+                  Uint32 transId2,
+                  bool dirty,
+                  Uint32 savepointId)
 {
   jamEntry();
   FragrecordPtr fragPtr;
@@ -341,30 +349,40 @@ Dbtup::tuxQueryTh(Uint32 fragPtrI, Uint3
   ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
   PagePtr pagePtr;
   pagePtr.i = pageId;
-  ptrCheckGuard(pagePtr, cnoOfPage, page);
+  c_page_pool.getPtr(pagePtr);
+
+  KeyReqStruct req_struct;
+
+  {
+    Operationrec tmpOp;
+    tmpOp.m_tuple_location.m_page_no = pageId;
+    tmpOp.m_tuple_location.m_page_idx = pageIndex;
+    setup_fixed_part(&req_struct, &tmpOp, tablePtr.p);
+  }
+
+  Tuple_header* tuple_ptr = req_struct.m_tuple_ptr;
 
   OperationrecPtr currOpPtr;
-  currOpPtr.i = pagePtr.p->pageWord[pageOffset];
+  currOpPtr.i = tuple_ptr->m_operation_ptr_i;
   if (currOpPtr.i == RNIL) {
-    ljam();
+    jam();
     // tuple has no operation, any scan can see it
     return true;
   }
-  ptrCheckGuard(currOpPtr, cnoOfOprec, operationrec);
+  c_operation_pool.getPtr(currOpPtr);
 
   const bool sameTrans =
-    transId1 == currOpPtr.p->transid1 &&
-    transId2 == currOpPtr.p->transid2;
+    c_lqh->is_same_trans(currOpPtr.p->userpointer, transId1, transId2);
 
   bool res = false;
   OperationrecPtr loopOpPtr = currOpPtr;
 
   if (!sameTrans) {
-    ljam();
+    jam();
     if (!dirty) {
-      ljam();
-      if (currOpPtr.p->prevActiveOp == RNIL) {
-        ljam();
+      jam();
+      if (currOpPtr.p->nextActiveOp == RNIL) {
+        jam();
         // last op - TUX makes ACC lock request in same timeslice
         res = true;
       }
@@ -372,33 +390,33 @@ Dbtup::tuxQueryTh(Uint32 fragPtrI, Uint3
     else {
       // loop to first op (returns false)
       find_savepoint(loopOpPtr, 0);
-      const Uint32 op_type = loopOpPtr.p->optype;
+      const Uint32 op_type = loopOpPtr.p->op_struct.op_type;
 
       if (op_type != ZINSERT) {
-        ljam();
-        // read committed version from the page
-        const Uint32 origVersion = pagePtr.p->pageWord[pageOffset + 1];
+        jam();
+        // read committed version
+        const Uint32 origVersion = tuple_ptr->get_tuple_version();
         if (origVersion == tupVersion) {
-          ljam();
+          jam();
           res = true;
         }
       }
     }
   }
   else {
-    ljam();
+    jam();
     // for own trans, ignore dirty flag
 
-    if (find_savepoint(loopOpPtr, savePointId)) {
-      ljam();
-      const Uint32 op_type = loopOpPtr.p->optype;
+    if (find_savepoint(loopOpPtr, savepointId)) {
+      jam();
+      const Uint32 op_type = loopOpPtr.p->op_struct.op_type;
 
       if (op_type != ZDELETE) {
-        ljam();
+        jam();
         // check if this op has produced the scanned version
         Uint32 loopVersion = loopOpPtr.p->tupVersion;
         if (loopVersion == tupVersion) {
-          ljam();
+          jam();
           res = true;
         }
       }
Thread
bk commit into 5.1 tree (pekka:1.2664) BUG#31477pekka28 Jan