From: Date: January 30 2008 11:58am
Subject: bk commit into 5.0 tree (jonas:1.2591) BUG#34160
List-Archive: http://lists.mysql.com/commits/41412
X-Bug: 34160
Message-Id: <20080130105813.853437B8BF@perch.localdomain>
Below is the list of changes that have just been committed into a local
5.0 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 11:58:10+01:00, jonas@stripped +2 -0
ndb - bug#34160
make sure release of not added ptr does not corrupt hashtable
ndb/src/kernel/vm/DLHashTable.hpp@stripped, 2008-01-30 11:58:09+01:00, jonas@stripped +18 -4
ndb - bug#34160
make sure release of not added ptr does not corrupt hashtable
ndb/src/kernel/vm/DLHashTable2.hpp@stripped, 2008-01-30 11:58:09+01:00, jonas@stripped +18 -4
ndb - bug#34160
make sure release of not added ptr does not corrupt hashtable
diff -Nrup a/ndb/src/kernel/vm/DLHashTable.hpp b/ndb/src/kernel/vm/DLHashTable.hpp
--- a/ndb/src/kernel/vm/DLHashTable.hpp 2006-12-23 20:04:16 +01:00
+++ b/ndb/src/kernel/vm/DLHashTable.hpp 2008-01-30 11:58:09 +01:00
@@ -45,8 +45,8 @@ public:
/**
* Seize element from pool - return i
*
- * Note must be either added using add or released
- * using release
+ * Note *must* be added using add (even before hash.release)
+ * or be released using pool
*/
bool seize(Ptr &);
@@ -374,7 +374,14 @@ DLHashTable::remove(Ptr & ptr){
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 @@ DLHashTable::release(Ptr & ptr){
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){
diff -Nrup a/ndb/src/kernel/vm/DLHashTable2.hpp b/ndb/src/kernel/vm/DLHashTable2.hpp
--- a/ndb/src/kernel/vm/DLHashTable2.hpp 2006-12-23 20:04:16 +01:00
+++ b/ndb/src/kernel/vm/DLHashTable2.hpp 2008-01-30 11:58:09 +01:00
@@ -43,8 +43,8 @@ public:
/**
* Seize element from pool - return i
*
- * Note must be either added using add or released
- * using release
+ * Note *must* be added using add (even before hash.release)
+ * or be released using pool
*/
bool seize(Ptr &);
@@ -375,7 +375,14 @@ DLHashTable2::remove(Ptr & ptr)
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 @@ DLHashTable2::release(Ptr & ptr
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){