diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2006-05-16 10:37:40 +0200 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2006-05-16 10:37:40 +0200 |
commit | 37b79d90d3b46122ef42f1fec342e895664ec71c (patch) | |
tree | 83f5d73ce1228e4e6dc0f0f5c079508f5a2757e2 /storage/ndb/src/ndbapi/DictCache.cpp | |
parent | 17c9545617dd8b8fde47f1ad6b95c09fe2149dd7 (diff) | |
parent | 326ebe4c5bc162a42adff43c138af144a02cdcb0 (diff) | |
download | mariadb-git-37b79d90d3b46122ef42f1fec342e895664ec71c.tar.gz |
Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
client/mysql.cc:
Auto merged
mysql-test/r/func_str.result:
Auto merged
mysql-test/r/rpl_temporary.result:
Auto merged
mysql-test/r/select.result:
Auto merged
mysql-test/t/rpl_temporary.test:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/sql_show.cc:
Auto merged
storage/ndb/src/ndbapi/ClusterMgr.cpp:
Auto merged
storage/ndb/src/ndbapi/ClusterMgr.hpp:
Auto merged
storage/ndb/src/ndbapi/DictCache.hpp:
Auto merged
storage/ndb/src/ndbapi/TransporterFacade.hpp:
Auto merged
storage/ndb/src/ndbapi/ndb_cluster_connection.cpp:
Auto merged
storage/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp:
Auto merged
mysql-test/r/information_schema.result:
manual merge
mysql-test/t/information_schema.test:
manual merge
sql/ha_ndbcluster.cc:
manual merge
storage/ndb/include/ndbapi/ndb_cluster_connection.hpp:
manual merge
storage/ndb/src/ndbapi/DictCache.cpp:
manual merge
Diffstat (limited to 'storage/ndb/src/ndbapi/DictCache.cpp')
-rw-r--r-- | storage/ndb/src/ndbapi/DictCache.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/storage/ndb/src/ndbapi/DictCache.cpp b/storage/ndb/src/ndbapi/DictCache.cpp index 47e48974449..0933578eed3 100644 --- a/storage/ndb/src/ndbapi/DictCache.cpp +++ b/storage/ndb/src/ndbapi/DictCache.cpp @@ -280,6 +280,41 @@ GlobalDictCache::put(const char * name, NdbTableImpl * tab) DBUG_RETURN(tab); } +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, int invalidate) { |