diff options
author | unknown <mskold@mysql.com> | 2006-02-08 10:08:18 +0100 |
---|---|---|
committer | unknown <mskold@mysql.com> | 2006-02-08 10:08:18 +0100 |
commit | 6ba820f25d7fac050c045b4fa9162bcdc89bcf9a (patch) | |
tree | 6355d1063977f26fbcb811672eeeaae67a58afd3 /storage | |
parent | 2f3705752a08c561d68e9676d6e9506468fa4bb3 (diff) | |
parent | 5a7517422677175af55f678060d572f77d2f20b7 (diff) | |
download | mariadb-git-6ba820f25d7fac050c045b4fa9162bcdc89bcf9a.tar.gz |
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/usr/local/home/marty/MySQL/mysql-5.1-new
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Auto merged
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Auto merged
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Auto merged
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp:
Auto merged
Diffstat (limited to 'storage')
-rw-r--r-- | storage/ndb/include/ndbapi/NdbDictionary.hpp | 8 | ||||
-rw-r--r-- | storage/ndb/include/ndbapi/NdbEventOperation.hpp | 1 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/NdbDictionary.cpp | 7 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp | 7 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/NdbEventOperation.cpp | 4 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp | 8 |
6 files changed, 35 insertions, 0 deletions
diff --git a/storage/ndb/include/ndbapi/NdbDictionary.hpp b/storage/ndb/include/ndbapi/NdbDictionary.hpp index 59c73c91f6e..8a8ddc6caae 100644 --- a/storage/ndb/include/ndbapi/NdbDictionary.hpp +++ b/storage/ndb/include/ndbapi/NdbDictionary.hpp @@ -1597,6 +1597,14 @@ public: */ const Table * getTable(const char * name) const; +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL + /* + * Save a table definition in dictionary cache + * @param table Object to put into cache + */ + void putTable(const Table * table); +#endif + /** * Get index with given name, NULL if undefined * @param indexName Name of index to get. diff --git a/storage/ndb/include/ndbapi/NdbEventOperation.hpp b/storage/ndb/include/ndbapi/NdbEventOperation.hpp index 698b66ce701..25d7b8c6644 100644 --- a/storage/ndb/include/ndbapi/NdbEventOperation.hpp +++ b/storage/ndb/include/ndbapi/NdbEventOperation.hpp @@ -220,6 +220,7 @@ public: #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL /** these are subject to change at any time */ + const NdbDictionary::Table* getTable() const; const NdbDictionary::Event *getEvent() const; const NdbRecAttr *getFirstPkAttr() const; const NdbRecAttr *getFirstPkPreAttr() const; diff --git a/storage/ndb/src/ndbapi/NdbDictionary.cpp b/storage/ndb/src/ndbapi/NdbDictionary.cpp index 72b9ed27fec..cfa6d7a0135 100644 --- a/storage/ndb/src/ndbapi/NdbDictionary.cpp +++ b/storage/ndb/src/ndbapi/NdbDictionary.cpp @@ -1349,6 +1349,13 @@ NdbDictionary::Dictionary::getTable(const char * name, void **data) const return 0; } +void NdbDictionary::Dictionary::putTable(const NdbDictionary::Table * table) +{ + NdbDictionary::Table *copy_table = new NdbDictionary::Table; + *copy_table = *table; + m_impl.putTable(&NdbTableImpl::getImpl(*copy_table)); +} + void NdbDictionary::Dictionary::set_local_table_data_size(unsigned sz) { m_impl.m_local_table_data_size= sz; diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 17a637c9567..5a458c24aa2 100644 --- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1305,7 +1305,14 @@ NdbDictionaryImpl::fetchGlobalTableImpl(const BaseString& internalTableName) void NdbDictionaryImpl::putTable(NdbTableImpl *impl) { + NdbTableImpl *old; + m_globalHash->lock(); + if ((old= m_globalHash->get(impl->m_internalName.c_str()))) + { + old->m_status = NdbDictionary::Object::Invalid; + m_globalHash->drop(old); + } m_globalHash->put(impl->m_internalName.c_str(), impl); m_globalHash->unlock(); Ndb_local_table_info *info= diff --git a/storage/ndb/src/ndbapi/NdbEventOperation.cpp b/storage/ndb/src/ndbapi/NdbEventOperation.cpp index 71bb8889614..4e96ee63565 100644 --- a/storage/ndb/src/ndbapi/NdbEventOperation.cpp +++ b/storage/ndb/src/ndbapi/NdbEventOperation.cpp @@ -144,6 +144,10 @@ NdbEventOperation::print() /* * Internal for the mysql server */ +const NdbDictionary::Table *NdbEventOperation::getTable() const +{ + return m_impl.m_eventImpl->m_tableImpl->m_facade; +} const NdbDictionary::Event *NdbEventOperation::getEvent() const { return m_impl.m_eventImpl->m_facade; diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp index 82bfb8e2228..c7f0bf85bce 100644 --- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp @@ -645,6 +645,14 @@ NdbEventOperationImpl::receive_event() m_buffer.length() / 4, true); m_buffer.clear(); + if (at) + at->buildColumnHash(); + else + { + DBUG_PRINT_EVENT("info", ("Failed to parse DictTabInfo error %u", + error.code)); + DBUG_RETURN_EVENT(1); + } if ( m_eventImpl->m_tableImpl) delete m_eventImpl->m_tableImpl; m_eventImpl->m_tableImpl = at; |