summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <geert@kriem.kemuri.org>2005-04-29 14:46:53 +0200
committerunknown <geert@kriem.kemuri.org>2005-04-29 14:46:53 +0200
commit2e9e0dfaa4f8f5b6e028981299ef4ba6f87758b4 (patch)
tree17e0d7dc5d8359528d97e5a697fdbe661e1ecf58 /ndb
parentded8a073815e9a75a89ebebed8152f46512ab913 (diff)
parentd64b4abbc3c682cfbdb126e893c31cb431c519ee (diff)
downloadmariadb-git-2e9e0dfaa4f8f5b6e028981299ef4ba6f87758b4.tar.gz
Merge gvanderkelen@bk-internal.mysql.com:/home/bk/mysql-5.0
into kriem.kemuri.org:/home/geert/MySQL/mysql-5.0 client/mysql.cc: Auto merged
Diffstat (limited to 'ndb')
-rw-r--r--ndb/include/ndbapi/NdbDictionary.hpp5
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.cpp11
2 files changed, 11 insertions, 5 deletions
diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp
index 7a945c1c22e..86130be4c4b 100644
--- a/ndb/include/ndbapi/NdbDictionary.hpp
+++ b/ndb/include/ndbapi/NdbDictionary.hpp
@@ -76,8 +76,11 @@ public:
Changed, ///< The object has been modified in memory
///< and has to be commited in NDB Kernel for
///< changes to take effect
- Retrieved ///< The object exist and has been read
+ Retrieved, ///< The object exist and has been read
///< into main memory from NDB Kernel
+ Invalid ///< The object has been invalidated
+ ///< and should not be used
+
};
/**
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index ff87a72f636..96c8f6020e5 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -1526,6 +1526,7 @@ int NdbDictionaryImpl::alterTable(NdbTableImpl &impl)
// If in local cache it must be in global
if (!cachedImpl)
abort();
+ cachedImpl->m_status = NdbDictionary::Object::Invalid;
m_globalHash->drop(cachedImpl);
m_globalHash->unlock();
}
@@ -1830,8 +1831,8 @@ NdbDictionaryImpl::dropTable(const char * name)
DBUG_PRINT("info",("INCOMPATIBLE_VERSION internal_name: %s", internalTableName));
m_localHash.drop(internalTableName);
-
m_globalHash->lock();
+ tab->m_status = NdbDictionary::Object::Invalid;
m_globalHash->drop(tab);
m_globalHash->unlock();
DBUG_RETURN(dropTable(name));
@@ -1875,10 +1876,11 @@ NdbDictionaryImpl::dropTable(NdbTableImpl & impl)
int ret = m_receiver.dropTable(impl);
if(ret == 0 || m_error.code == 709){
const char * internalTableName = impl.m_internalName.c_str();
+
m_localHash.drop(internalTableName);
-
m_globalHash->lock();
+ impl.m_status = NdbDictionary::Object::Invalid;
m_globalHash->drop(&impl);
m_globalHash->unlock();
@@ -1976,6 +1978,7 @@ NdbDictionaryImpl::invalidateObject(NdbTableImpl & impl)
m_localHash.drop(internalTableName);
m_globalHash->lock();
+ impl.m_status = NdbDictionary::Object::Invalid;
m_globalHash->drop(&impl);
m_globalHash->unlock();
return 0;
@@ -2242,8 +2245,8 @@ NdbDictionaryImpl::dropIndex(const char * indexName,
m_ndb.internalizeTableName(indexName); // Index is also a table
m_localHash.drop(internalIndexName);
-
m_globalHash->lock();
+ idx->m_table->m_status = NdbDictionary::Object::Invalid;
m_globalHash->drop(idx->m_table);
m_globalHash->unlock();
return dropIndex(indexName, tableName);
@@ -2277,8 +2280,8 @@ NdbDictionaryImpl::dropIndex(NdbIndexImpl & impl, const char * tableName)
int ret = m_receiver.dropIndex(impl, *timpl);
if(ret == 0){
m_localHash.drop(internalIndexName);
-
m_globalHash->lock();
+ impl.m_table->m_status = NdbDictionary::Object::Invalid;
m_globalHash->drop(impl.m_table);
m_globalHash->unlock();
}