summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <mskold@mysql.com>2005-04-27 18:17:41 +0200
committerunknown <mskold@mysql.com>2005-04-27 18:17:41 +0200
commit27a6a8146417829d9edfcb8fb86306f985e03bd2 (patch)
tree271a87a13563c1c954f883b1f0422343d6f16a41 /ndb
parentb580f8ddf509f4f1e2c28b1ed49f440de918286b (diff)
downloadmariadb-git-27a6a8146417829d9edfcb8fb86306f985e03bd2.tar.gz
Fix for avoiding gettin Invalid schema object version when doing local changes
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 6aa675a2319..0e4f506c604 100644
--- a/ndb/include/ndbapi/NdbDictionary.hpp
+++ b/ndb/include/ndbapi/NdbDictionary.hpp
@@ -75,8 +75,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 fb2e0d673cd..4523ae2c261 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -1448,6 +1448,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();
}
@@ -1747,8 +1748,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));
@@ -1792,10 +1793,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();
@@ -1889,6 +1891,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;
@@ -2152,8 +2155,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);
@@ -2187,8 +2190,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();
}