Commit a366d6ee authored by unknown's avatar unknown

bug, releaseTableObject called twice

bug, whole bucket removed if delete first element in bucket


ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  bug, releaseTableObject called twice
ndb/src/ndbapi/NdbLinHash.hpp:
  bug, whole bucket removed if delete first element in bucket
parent 8090516c
...@@ -2868,7 +2868,6 @@ Dbdict::execALTER_TABLE_REQ(Signal* signal) ...@@ -2868,7 +2868,6 @@ Dbdict::execALTER_TABLE_REQ(Signal* signal)
jam(); jam();
c_opCreateTable.release(alterTabPtr); c_opCreateTable.release(alterTabPtr);
parseRecord.tablePtr.p->tabState = TableRecord::NOT_DEFINED; parseRecord.tablePtr.p->tabState = TableRecord::NOT_DEFINED;
releaseTableObject(parseRecord.tablePtr.i, false);
alterTableRef(signal, req, alterTableRef(signal, req,
(AlterTableRef::ErrorCode) parseRecord.errorCode, (AlterTableRef::ErrorCode) parseRecord.errorCode,
aParseRecord); aParseRecord);
...@@ -3054,7 +3053,6 @@ Dbdict::execALTER_TAB_REQ(Signal * signal) ...@@ -3054,7 +3053,6 @@ Dbdict::execALTER_TAB_REQ(Signal * signal)
jam(); jam();
c_opCreateTable.release(alterTabPtr); c_opCreateTable.release(alterTabPtr);
parseRecord.tablePtr.p->tabState = TableRecord::NOT_DEFINED; parseRecord.tablePtr.p->tabState = TableRecord::NOT_DEFINED;
releaseTableObject(parseRecord.tablePtr.i, false);
alterTabRef(signal, req, alterTabRef(signal, req,
(AlterTableRef::ErrorCode) parseRecord.errorCode, (AlterTableRef::ErrorCode) parseRecord.errorCode,
aParseRecord); aParseRecord);
......
...@@ -287,17 +287,14 @@ NdbLinHash<C>::deleteKey ( const char* str, Uint32 len){ ...@@ -287,17 +287,14 @@ NdbLinHash<C>::deleteKey ( const char* str, Uint32 len){
NdbElement_t<C> **chainp = &directory[dir]->elements[seg]; NdbElement_t<C> **chainp = &directory[dir]->elements[seg];
for(NdbElement_t<C> * chain = *chainp; chain != 0; chain = chain->next){ for(NdbElement_t<C> * chain = *chainp; chain != 0; chain = chain->next){
if(chain->len == len && !memcmp(chain->str, str, len)){ if(chain->len == len && !memcmp(chain->str, str, len)){
if (oldChain == 0) {
C *data= chain->theData; C *data= chain->theData;
delete chain; if (oldChain == 0) {
* chainp = 0; * chainp = chain->next;
return data;
} else { } else {
C *data= chain->theData;
oldChain->next = chain->next; oldChain->next = chain->next;
}
delete chain; delete chain;
return data; return data;
}
} else { } else {
oldChain = chain; oldChain = chain;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment