Commit 7515696d authored by mskold@mysql.com's avatar mskold@mysql.com

NdbEventOperationImpl.cpp, NdbEventOperation.cpp, NdbEventOperation.hpp:

  Put back getTable
NdbDictionaryImpl.cpp, NdbDictionary.cpp, NdbDictionary.hpp:
  Added putTable
parent bcb4178c
...@@ -1588,6 +1588,14 @@ public: ...@@ -1588,6 +1588,14 @@ public:
*/ */
const Table * getTable(const char * name) const; 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 * Get index with given name, NULL if undefined
* @param indexName Name of index to get. * @param indexName Name of index to get.
......
...@@ -220,6 +220,7 @@ public: ...@@ -220,6 +220,7 @@ public:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/** these are subject to change at any time */ /** these are subject to change at any time */
const NdbDictionary::Table* getTable() const;
const NdbDictionary::Event *getEvent() const; const NdbDictionary::Event *getEvent() const;
const NdbRecAttr *getFirstPkAttr() const; const NdbRecAttr *getFirstPkAttr() const;
const NdbRecAttr *getFirstPkPreAttr() const; const NdbRecAttr *getFirstPkPreAttr() const;
......
...@@ -1337,6 +1337,13 @@ NdbDictionary::Dictionary::getTable(const char * name, void **data) const ...@@ -1337,6 +1337,13 @@ NdbDictionary::Dictionary::getTable(const char * name, void **data) const
return 0; 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) void NdbDictionary::Dictionary::set_local_table_data_size(unsigned sz)
{ {
m_impl.m_local_table_data_size= sz; m_impl.m_local_table_data_size= sz;
......
...@@ -1271,7 +1271,14 @@ NdbDictionaryImpl::fetchGlobalTableImpl(const BaseString& internalTableName) ...@@ -1271,7 +1271,14 @@ NdbDictionaryImpl::fetchGlobalTableImpl(const BaseString& internalTableName)
void void
NdbDictionaryImpl::putTable(NdbTableImpl *impl) NdbDictionaryImpl::putTable(NdbTableImpl *impl)
{ {
NdbTableImpl *old;
m_globalHash->lock(); 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->put(impl->m_internalName.c_str(), impl);
m_globalHash->unlock(); m_globalHash->unlock();
Ndb_local_table_info *info= Ndb_local_table_info *info=
......
...@@ -144,6 +144,10 @@ NdbEventOperation::print() ...@@ -144,6 +144,10 @@ NdbEventOperation::print()
/* /*
* Internal for the mysql server * 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 const NdbDictionary::Event *NdbEventOperation::getEvent() const
{ {
return m_impl.m_eventImpl->m_facade; return m_impl.m_eventImpl->m_facade;
......
...@@ -639,6 +639,14 @@ NdbEventOperationImpl::receive_event() ...@@ -639,6 +639,14 @@ NdbEventOperationImpl::receive_event()
m_buffer.length() / 4, m_buffer.length() / 4,
true); true);
m_buffer.clear(); 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) if ( m_eventImpl->m_tableImpl)
delete m_eventImpl->m_tableImpl; delete m_eventImpl->m_tableImpl;
m_eventImpl->m_tableImpl = at; m_eventImpl->m_tableImpl = at;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment