1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-08 06:27:57 +03:00

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
This commit is contained in:
tomas@poseidon.(none)
2004-09-14 08:52:21 +00:00
parent 74336d596f
commit 21a4b1b4e6
13 changed files with 261 additions and 92 deletions

View File

@@ -595,11 +595,12 @@ static int f_dictionary_count = 0;
NdbDictionaryImpl::~NdbDictionaryImpl()
{
NdbElement_t<NdbTableImpl> * curr = m_localHash.m_tableHash.getNext(0);
NdbElement_t<Ndb_local_table_info> * curr = m_localHash.m_tableHash.getNext(0);
if(m_globalHash){
while(curr != 0){
m_globalHash->lock();
m_globalHash->release(curr->theData);
m_globalHash->release(curr->theData->m_table_impl);
delete curr->theData;
m_globalHash->unlock();
curr = m_localHash.m_tableHash.getNext(curr);
@@ -620,7 +621,39 @@ NdbDictionaryImpl::~NdbDictionaryImpl()
}
}
Ndb_local_table_info *
NdbDictionaryImpl::fetchGlobalTableImpl(const char * internalTableName)
{
NdbTableImpl *impl;
m_globalHash->lock();
impl = m_globalHash->get(internalTableName);
m_globalHash->unlock();
if (impl == 0){
impl = m_receiver.getTable(internalTableName, m_ndb.usingFullyQualifiedNames());
m_globalHash->lock();
m_globalHash->put(internalTableName, impl);
m_globalHash->unlock();
if(impl == 0){
return 0;
}
}
Ndb_local_table_info *info= new Ndb_local_table_info(impl, 32);
info->m_first_tuple_id= ~0;
info->m_last_tuple_id= ~0;
m_localHash.put(internalTableName, info);
m_ndb.theFirstTupleId[impl->getTableId()] = ~0;
m_ndb.theLastTupleId[impl->getTableId()] = ~0;
addBlobTables(*impl);
return info;
}
#if 0
bool
@@ -1504,7 +1537,6 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
: createTable(&tSignal, ptr);
if (!alter && haveAutoIncrement) {
// if (!ndb.setAutoIncrementValue(impl.m_internalName.c_str(), autoIncrementValue)) {
if (!ndb.setAutoIncrementValue(impl.m_externalName.c_str(), autoIncrementValue)) {
if (ndb.theError.code == 0) {
m_error.code = 4336;
@@ -1775,11 +1807,12 @@ NdbIndexImpl*
NdbDictionaryImpl::getIndexImpl(const char * externalName,
const char * internalName)
{
NdbTableImpl* tab = getTableImpl(internalName);
if(tab == 0){
Ndb_local_table_info * info = get_local_table_info(internalName);
if(info == 0){
m_error.code = 4243;
return 0;
}
NdbTableImpl * tab = info->m_table_impl;
if(tab->m_indexType == NdbDictionary::Index::Undefined){
// Not an index