summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-09-26 10:03:57 +0200
committerunknown <joreland@mysql.com>2004-09-26 10:03:57 +0200
commit2de9ef17262a87c2b4d28c301387fcb26bba9b05 (patch)
tree58624f148792ec3d0f37c8e1a49572fd6c09af9c
parent0ef58d54886429896a6146803a7cf21822ad075b (diff)
downloadmariadb-git-2de9ef17262a87c2b4d28c301387fcb26bba9b05.tar.gz
testDict -n InvalidTables
ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Add more require's in VM_TRACE Fix release of invalid tables testDict -n InvalidTables
-rw-r--r--ndb/src/kernel/blocks/dbdict/Dbdict.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
index 97270b65132..d1a8128ea7f 100644
--- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
@@ -3475,12 +3475,19 @@ int Dbdict::handleAlterTab(AlterTabReq * req,
jam();
// Table rename
// Remove from hashtable
+#ifdef VM_TRACE
+ TableRecordPtr tmp;
+ ndbrequire(c_tableRecordHash.find(tmp, *origTablePtr.p));
+#endif
c_tableRecordHash.remove(origTablePtr);
strcpy(regAlterTabPtr->previousTableName, origTablePtr.p->tableName);
strcpy(origTablePtr.p->tableName, newTablePtr.p->tableName);
// Set new schema version
origTablePtr.p->tableVersion = newTablePtr.p->tableVersion;
// Put it back
+#ifdef VM_TRACE
+ ndbrequire(!c_tableRecordHash.find(tmp, *origTablePtr.p));
+#endif
c_tableRecordHash.add(origTablePtr);
return 0;
@@ -3501,12 +3508,19 @@ void Dbdict::revertAlterTable(Signal * signal,
TableRecordPtr tablePtr;
c_tableRecordPool.getPtr(tablePtr, tableId);
// Remove from hashtable
+#ifdef VM_TRACE
+ TableRecordPtr tmp;
+ ndbrequire(c_tableRecordHash.find(tmp, * tablePtr.p));
+#endif
c_tableRecordHash.remove(tablePtr);
// Restore name
strcpy(tablePtr.p->tableName, regAlterTabPtr->previousTableName);
// Revert schema version
tablePtr.p->tableVersion = tablePtr.p->tableVersion - 1;
// Put it back
+#ifdef VM_TRACE
+ ndbrequire(!c_tableRecordHash.find(tmp, * tablePtr.p));
+#endif
c_tableRecordHash.add(tablePtr);
return;
@@ -4644,6 +4658,8 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it,
jam();
#ifdef VM_TRACE
ndbout_c("Dbdict: name=%s,id=%u", tablePtr.p->tableName, tablePtr.i);
+ TableRecordPtr tmp;
+ ndbrequire(!c_tableRecordHash.find(tmp, * tablePtr.p));
#endif
c_tableRecordHash.add(tablePtr);
}
@@ -4690,7 +4706,7 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it,
/**
* Release table
*/
- releaseTableObject(tablePtr.i, !checkExist);
+ releaseTableObject(tablePtr.i, checkExist);
}
}//handleTabInfoInit()
@@ -5501,8 +5517,13 @@ void Dbdict::releaseTableObject(Uint32 tableId, bool removeFromHash)
AttributeRecordPtr attrPtr;
c_tableRecordPool.getPtr(tablePtr, tableId);
if (removeFromHash)
+ {
+#ifdef VM_TRACE
+ TableRecordPtr tmp;
+ ndbrequire(c_tableRecordHash.find(tmp, * tablePtr.p));
+#endif
c_tableRecordHash.remove(tablePtr);
-
+ }
tablePtr.p->tabState = TableRecord::NOT_DEFINED;
Uint32 nextAttrRecord = tablePtr.p->firstAttribute;