18 #ifndef NDB_TABLE_GUARD_H
19 #define NDB_TABLE_GUARD_H
21 #include <ndbapi/NdbDictionary.hpp>
27 : m_dict(dict), m_ndbtab(NULL), m_invalidate(0)
30 : m_dict(dict), m_ndbtab(NULL), m_invalidate(0)
32 DBUG_ENTER(
"Ndb_table_guard");
38 DBUG_ENTER(
"~Ndb_table_guard");
42 void init(
const char *tabname)
44 DBUG_ENTER(
"Ndb_table_guard::init");
46 DBUG_ASSERT(m_ndbtab == NULL);
47 m_ndbtab= m_dict->getTableGlobal(tabname);
49 DBUG_PRINT(
"info", (
"m_ndbtab: %p", m_ndbtab));
52 void reinit(
const char *tabname= 0)
54 DBUG_ENTER(
"Ndb_table_guard::reinit");
57 DBUG_PRINT(
"info", (
"m_ndbtab: %p m_invalidate: %d",
58 m_ndbtab, m_invalidate));
59 m_dict->removeTableGlobal(*m_ndbtab, m_invalidate);
65 DBUG_PRINT(
"info", (
"m_ndbtab: %p", m_ndbtab));
69 void invalidate() { m_invalidate= 1; }
72 DBUG_ENTER(
"Ndb_table_guard::release");
74 DBUG_PRINT(
"info", (
"m_ndbtab: %p", m_ndbtab));