Commit ad97790a authored by unknown's avatar unknown

MySQL Bugs: #16925: ndb, added additional getters on NdbDictionary::Event


storage/ndb/include/ndbapi/NdbDictionary.hpp:
  ndb, added additional getters on NdbDictionary::Event
storage/ndb/src/ndbapi/NdbDictionary.cpp:
  ndb, added additional getters on NdbDictionary::Event
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  ndb, added additional getters on NdbDictionary::Event
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
  ndb, added additional getters on NdbDictionary::Event
parent e379b87e
...@@ -1217,6 +1217,10 @@ public: ...@@ -1217,6 +1217,10 @@ public:
* Add type of event that should be detected * Add type of event that should be detected
*/ */
void addTableEvent(const TableEvent te); 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 * Set durability of the event
*/ */
...@@ -1270,6 +1274,11 @@ public: ...@@ -1270,6 +1274,11 @@ public:
*/ */
int getNoOfEventColumns() const; 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 * The merge events flag is false by default. Setting it true
* implies that events are merged in following ways: * implies that events are merged in following ways:
......
...@@ -857,6 +857,12 @@ NdbDictionary::Event::addTableEvent(const TableEvent t) ...@@ -857,6 +857,12 @@ NdbDictionary::Event::addTableEvent(const TableEvent t)
m_impl.addTableEvent(t); m_impl.addTableEvent(t);
} }
bool
NdbDictionary::Event::getTableEvent(const TableEvent t) const
{
return m_impl.getTableEvent(t);
}
void void
NdbDictionary::Event::setDurability(EventDurability d) NdbDictionary::Event::setDurability(EventDurability d)
{ {
...@@ -913,6 +919,29 @@ int NdbDictionary::Event::getNoOfEventColumns() const ...@@ -913,6 +919,29 @@ int NdbDictionary::Event::getNoOfEventColumns() const
return m_impl.getNoOfEventColumns(); 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) void NdbDictionary::Event::mergeEvents(bool flag)
{ {
m_impl.m_mergeEvents = flag; m_impl.m_mergeEvents = flag;
......
...@@ -1143,6 +1143,12 @@ NdbEventImpl::addTableEvent(const NdbDictionary::Event::TableEvent t = NdbDicti ...@@ -1143,6 +1143,12 @@ NdbEventImpl::addTableEvent(const NdbDictionary::Event::TableEvent t = NdbDicti
mi_type |= (unsigned)t; mi_type |= (unsigned)t;
} }
bool
NdbEventImpl::getTableEvent(const NdbDictionary::Event::TableEvent t) const
{
return (mi_type & (unsigned)t) == (unsigned)t;
}
void void
NdbEventImpl::setDurability(NdbDictionary::Event::EventDurability d) NdbEventImpl::setDurability(NdbDictionary::Event::EventDurability d)
{ {
......
...@@ -281,6 +281,7 @@ public: ...@@ -281,6 +281,7 @@ public:
void setTable(const char * table); void setTable(const char * table);
const char * getTableName() const; const char * getTableName() const;
void addTableEvent(const NdbDictionary::Event::TableEvent t); void addTableEvent(const NdbDictionary::Event::TableEvent t);
bool getTableEvent(const NdbDictionary::Event::TableEvent t) const;
void setDurability(NdbDictionary::Event::EventDurability d); void setDurability(NdbDictionary::Event::EventDurability d);
NdbDictionary::Event::EventDurability getDurability() const; NdbDictionary::Event::EventDurability getDurability() const;
void setReport(NdbDictionary::Event::EventReport r); void setReport(NdbDictionary::Event::EventReport r);
......
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