diff --git a/storage/ndb/include/ndbapi/NdbDictionary.hpp b/storage/ndb/include/ndbapi/NdbDictionary.hpp index d96ebc896c3..59c73c91f6e 100644 --- a/storage/ndb/include/ndbapi/NdbDictionary.hpp +++ b/storage/ndb/include/ndbapi/NdbDictionary.hpp @@ -1217,6 +1217,10 @@ public: * Add type of event that should be detected */ void addTableEvent(const TableEvent te); + /** + * Check if a specific table event will be detected + */ + bool getTableEvent(const TableEvent te) const; /** * Set durability of the event */ @@ -1270,6 +1274,11 @@ public: */ int getNoOfEventColumns() const; + /** + * Get a specific column in the event + */ + const Column * getEventColumn(unsigned no) const; + /** * The merge events flag is false by default. Setting it true * implies that events are merged in following ways: diff --git a/storage/ndb/src/ndbapi/NdbDictionary.cpp b/storage/ndb/src/ndbapi/NdbDictionary.cpp index ea60b36fdee..7e7be9c44e0 100644 --- a/storage/ndb/src/ndbapi/NdbDictionary.cpp +++ b/storage/ndb/src/ndbapi/NdbDictionary.cpp @@ -857,6 +857,12 @@ NdbDictionary::Event::addTableEvent(const TableEvent t) m_impl.addTableEvent(t); } +bool +NdbDictionary::Event::getTableEvent(const TableEvent t) const +{ + return m_impl.getTableEvent(t); +} + void NdbDictionary::Event::setDurability(EventDurability d) { @@ -913,6 +919,29 @@ int NdbDictionary::Event::getNoOfEventColumns() const return m_impl.getNoOfEventColumns(); } +const NdbDictionary::Column * +NdbDictionary::Event::getEventColumn(unsigned no) const +{ + if (m_impl.m_columns.size()) + { + if (no < m_impl.m_columns.size()) + { + return m_impl.m_columns[no]; + } + } + else if (m_impl.m_attrIds.size()) + { + if (no < m_impl.m_attrIds.size()) + { + NdbTableImpl* tab= m_impl.m_tableImpl; + if (tab == 0) + return 0; + return tab->getColumn(m_impl.m_attrIds[no]); + } + } + return 0; +} + void NdbDictionary::Event::mergeEvents(bool flag) { m_impl.m_mergeEvents = flag; diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 31234d683d7..05306baa614 100644 --- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1143,6 +1143,12 @@ NdbEventImpl::addTableEvent(const NdbDictionary::Event::TableEvent t = NdbDicti mi_type |= (unsigned)t; } +bool +NdbEventImpl::getTableEvent(const NdbDictionary::Event::TableEvent t) const +{ + return (mi_type & (unsigned)t) == (unsigned)t; +} + void NdbEventImpl::setDurability(NdbDictionary::Event::EventDurability d) { diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp index 1685c3122a3..656d0b5c79c 100644 --- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -281,6 +281,7 @@ public: void setTable(const char * table); const char * getTableName() const; void addTableEvent(const NdbDictionary::Event::TableEvent t); + bool getTableEvent(const NdbDictionary::Event::TableEvent t) const; void setDurability(NdbDictionary::Event::EventDurability d); NdbDictionary::Event::EventDurability getDurability() const; void setReport(NdbDictionary::Event::EventReport r);