List:Commits« Previous MessageNext Message »
From:jonas Date:January 30 2008 12:04pm
Subject:bk commit into 5.1 tree (jonas:1.2188) BUG#34160
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, 2008-01-30 12:04:37+01:00, jonas@stripped +2 -0
  ndb - bug#34160 (drop6)
    make sure release of not added ptr does not corrupt hashtable

  storage/ndb/src/kernel/vm/DLHashTable.hpp@stripped, 2008-01-30 12:04:36+01:00,
jonas@stripped +18 -4
    ndb - bug#34160
      make sure release of not added ptr does not corrupt hashtable

  storage/ndb/src/kernel/vm/DLHashTable2.hpp@stripped, 2008-01-30 12:04:36+01:00,
jonas@stripped +18 -4
    ndb - bug#34160
      make sure release of not added ptr does not corrupt hashtable

# 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:	perch.ndb.mysql.com
# Root:	/home/jonas/src/drop6

--- 1.4/storage/ndb/src/kernel/vm/DLHashTable.hpp	2008-01-30 12:04:40 +01:00
+++ 1.5/storage/ndb/src/kernel/vm/DLHashTable.hpp	2008-01-30 12:04:40 +01:00
@@ -46,8 +46,8 @@
   /**
    * Seize element from pool - return i
    *
-   * Note must be either added using <b>add</b> or released 
-   * using <b>release</b>
+   * Note *must* be added using <b>add</b> (even before hash.release)
+   *             or be released using pool
    */
   bool seize(Ptr<T> &);
 
@@ -375,7 +375,14 @@
     prevP->nextHash = next;
   } else {
     const Uint32 hv = ptr.p->hashValue() & mask;  
-    hashValues[hv] = next;
+    if (hashValues[hv] == ptr.i)
+    {
+      hashValues[hv] = next;
+    }
+    else
+    {
+      // Will add assert in 5.1
+    }
   }
   
   if(next != RNIL){
@@ -396,7 +403,14 @@
     prevP->nextHash = next;
   } else {
     const Uint32 hv = ptr.p->hashValue() & mask;  
-    hashValues[hv] = next;
+    if (hashValues[hv] == ptr.i)
+    {
+      hashValues[hv] = next;
+    }
+    else
+    {
+      // Will add assert in 5.1
+    }
   }
   
   if(next != RNIL){

--- 1.4/storage/ndb/src/kernel/vm/DLHashTable2.hpp	2008-01-30 12:04:40 +01:00
+++ 1.5/storage/ndb/src/kernel/vm/DLHashTable2.hpp	2008-01-30 12:04:40 +01:00
@@ -44,8 +44,8 @@
   /**
    * Seize element from pool - return i
    *
-   * Note must be either added using <b>add</b> or released 
-   * using <b>release</b>
+   * Note *must* be added using <b>add</b> (even before hash.release)
+   *             or be released using pool
    */
   bool seize(Ptr<T> &);
 
@@ -374,7 +374,14 @@
     prevP->nextHash = next;
   } else {
     const Uint32 hv = ptr.p->hashValue() & mask;  
-    hashValues[hv] = next;
+    if (hashValues[hv] == ptr.i)
+    {
+      hashValues[hv] = next;
+    }
+    else
+    {
+      // Will add assert in 5.1
+    }
   }
   
   if(next != RNIL){
@@ -395,7 +402,14 @@
     prevP->nextHash = next;
   } else {
     const Uint32 hv = ptr.p->hashValue() & mask;  
-    hashValues[hv] = next;
+    if (hashValues[hv] == ptr.i)
+    {
+      hashValues[hv] = next;
+    }
+    else
+    {
+      // Will add assert in 5.1
+    }
   }
   
   if(next != RNIL){
Thread
bk commit into 5.1 tree (jonas:1.2188) BUG#34160jonas30 Jan