summaryrefslogtreecommitdiff
path: root/ndb/src/ndbapi/DictCache.cpp
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2006-05-15 16:23:59 +0200
committerunknown <tomas@poseidon.ndb.mysql.com>2006-05-15 16:23:59 +0200
commit37f940ce86615ed0ae16e210ebc4fa92e8dfb2a6 (patch)
tree4e66c3e11b66c426e36236eee86b8b5ee7ad2f54 /ndb/src/ndbapi/DictCache.cpp
parentec83dd7c61f4e29122ecff278ca81b03bd51b271 (diff)
downloadmariadb-git-37f940ce86615ed0ae16e210ebc4fa92e8dfb2a6.tar.gz
Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
- invalidate ndb dict cache on cluster disconnect (ClusterMgr.cpp) - add check for correct frm on external lock when table cache is found invalid ndb/include/ndbapi/ndb_cluster_connection.hpp: Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail ndb/src/ndbapi/ClusterMgr.cpp: Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail ndb/src/ndbapi/ClusterMgr.hpp: Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail ndb/src/ndbapi/DictCache.cpp: Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail ndb/src/ndbapi/DictCache.hpp: Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail ndb/src/ndbapi/TransporterFacade.hpp: Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail ndb/src/ndbapi/ndb_cluster_connection.cpp: Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail ndb/src/ndbapi/ndb_cluster_connection_impl.hpp: Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail sql/ha_ndbcluster.cc: Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail mysql-test/r/ndb_autodiscover3.result: Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail mysql-test/t/ndb_autodiscover3.test: Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
Diffstat (limited to 'ndb/src/ndbapi/DictCache.cpp')
-rw-r--r--ndb/src/ndbapi/DictCache.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp
index ca361e900b1..9b6449e8ec5 100644
--- a/ndb/src/ndbapi/DictCache.cpp
+++ b/ndb/src/ndbapi/DictCache.cpp
@@ -255,6 +255,42 @@ GlobalDictCache::drop(NdbTableImpl * tab)
abort();
}
+
+unsigned
+GlobalDictCache::get_size()
+{
+ NdbElement_t<Vector<TableVersion> > * curr = m_tableHash.getNext(0);
+ int sz = 0;
+ while(curr != 0){
+ sz += curr->theData->size();
+ curr = m_tableHash.getNext(curr);
+ }
+ return sz;
+}
+
+void
+GlobalDictCache::invalidate_all()
+{
+ DBUG_ENTER("GlobalDictCache::invalidate_all");
+ NdbElement_t<Vector<TableVersion> > * curr = m_tableHash.getNext(0);
+ while(curr != 0){
+ Vector<TableVersion> * vers = curr->theData;
+ if (vers->size())
+ {
+ TableVersion * ver = & vers->back();
+ ver->m_impl->m_status = NdbDictionary::Object::Invalid;
+ ver->m_status = DROPPED;
+ if (ver->m_refCount == 0)
+ {
+ delete ver->m_impl;
+ vers->erase(vers->size() - 1);
+ }
+ }
+ curr = m_tableHash.getNext(curr);
+ }
+ DBUG_VOID_RETURN;
+}
+
void
GlobalDictCache::release(NdbTableImpl * tab){
unsigned i;