diff options
author | unknown <tomas@poseidon.(none)> | 2004-09-14 08:52:21 +0000 |
---|---|---|
committer | unknown <tomas@poseidon.(none)> | 2004-09-14 08:52:21 +0000 |
commit | 2e43e47040f8ece21b45e2d76089d6514788125c (patch) | |
tree | 831e0140e9ce404765e5a139b988a78d6a7d1f54 /ndb/src/ndbapi/NdbDictionaryImpl.hpp | |
parent | cd573513a3744adf86b68ffd50887baa9d12bbe1 (diff) | |
download | mariadb-git-2e43e47040f8ece21b45e2d76089d6514788125c.tar.gz |
moved all ndb thread specific data into new placeholder
new methods to keep "records" up to date
unset flag HA_NOT_EXACT_COUNT to make handler read "records" field, for count() optim and join optimization
new methods to keep "records" up to datecorrect record field in ndbcluster handler
new method for ndbcluster handler to store/retrieve table and thread specific data
changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl
hanged deleteKey to return ponter to deleted object
moved heavy global cache fetch from inline to separate method
mysql-test/r/ndb_alter_table.result:
correct record field in ndbcluster handler
mysql-test/r/ndb_blob.result:
correct record field in ndbcluster handler
ndb/include/ndbapi/NdbDictionary.hpp:
new method for ndbcluster handler to store/retrieve table and thread specific data
ndb/src/ndbapi/DictCache.cpp:
changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl
ndb/src/ndbapi/DictCache.hpp:
changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl
ndb/src/ndbapi/Ndb.cpp:
replaced method DictionaryImpl::getTable with DictionaryImpl::get_local_table_info
ndb/src/ndbapi/NdbDictionary.cpp:
new method for ndbcluster handler to store/retrieve table and thread specific data
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl
moved heavy global cache fetch from inline to separate method
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
replaced method DictionaryImpl::getTable with DictionaryImpl::get_local_table_info
ndb/src/ndbapi/NdbLinHash.hpp:
changed deleteKey to return ponter to deleted object
sql/ha_ndbcluster.cc:
moved all ndb thread specific data into new placeholder
new methods to keep "records" up to date
unset flag HA_NOT_EXACT_COUNT to make handler read "records" field, for count() optim and join optimization
sql/ha_ndbcluster.h:
new methods to keep "records" up to date
sql/sql_class.h:
moved all ndb thread specific data into new placeholder
Diffstat (limited to 'ndb/src/ndbapi/NdbDictionaryImpl.hpp')
-rw-r--r-- | ndb/src/ndbapi/NdbDictionaryImpl.hpp | 59 |
1 files changed, 22 insertions, 37 deletions
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp index 8f197856f57..cd0463f7126 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -390,8 +390,8 @@ public: int listObjects(List& list, NdbDictionary::Object::Type type); int listIndexes(List& list, const char * tableName); - NdbTableImpl * getTable(const char * tableName); - NdbTableImpl * getTableImpl(const char * internalName); + NdbTableImpl * getTable(const char * tableName, void **data= 0); + Ndb_local_table_info * get_local_table_info(const char * internalName); NdbIndexImpl * getIndex(const char * indexName, const char * tableName); NdbIndexImpl * getIndexImpl(const char * name, const char * internalName); @@ -410,6 +410,8 @@ public: NdbDictInterface m_receiver; Ndb & m_ndb; +private: + Ndb_local_table_info * fetchGlobalTableImpl(const char * internalName); }; inline @@ -598,45 +600,28 @@ NdbDictionaryImpl::getImpl(const NdbDictionary::Dictionary & t){ inline NdbTableImpl * -NdbDictionaryImpl::getTable(const char * tableName) +NdbDictionaryImpl::getTable(const char * tableName, void **data) { const char * internalTableName = m_ndb.internalizeTableName(tableName); - - return getTableImpl(internalTableName); + Ndb_local_table_info *info= get_local_table_info(internalTableName); + if (info == 0) { + return 0; + } + if (data) { + *data= info->m_local_data; + } + return info->m_table_impl; } inline -NdbTableImpl * -NdbDictionaryImpl::getTableImpl(const char * internalTableName) +Ndb_local_table_info * +NdbDictionaryImpl::get_local_table_info(const char * internalTableName) { - NdbTableImpl *ret = m_localHash.get(internalTableName); - - if (ret != 0) { - return ret; // autoincrement already initialized + Ndb_local_table_info *info= m_localHash.get(internalTableName); + if (info != 0) { + return info; // autoincrement already initialized } - - m_globalHash->lock(); - ret = m_globalHash->get(internalTableName); - m_globalHash->unlock(); - - if (ret == 0){ - ret = m_receiver.getTable(internalTableName, m_ndb.usingFullyQualifiedNames()); - m_globalHash->lock(); - m_globalHash->put(internalTableName, ret); - m_globalHash->unlock(); - - if(ret == 0){ - return 0; - } - } - m_localHash.put(internalTableName, ret); - - m_ndb.theFirstTupleId[ret->getTableId()] = ~0; - m_ndb.theLastTupleId[ret->getTableId()] = ~0; - - addBlobTables(*ret); - - return ret; + return fetchGlobalTableImpl(internalTableName); } inline @@ -654,9 +639,9 @@ NdbDictionaryImpl::getIndex(const char * indexName, internalIndexName = m_ndb.internalizeTableName(indexName); // Index is also a table } if (internalIndexName) { - NdbTableImpl * tab = getTableImpl(internalIndexName); - - if (tab) { + Ndb_local_table_info * info = get_local_table_info(internalIndexName); + if (info) { + NdbTableImpl * tab = info->m_table_impl; if (tab->m_index == 0) tab->m_index = getIndexImpl(indexName, internalIndexName); if (tab->m_index != 0) |