Commit 49d979d0 authored by unknown's avatar unknown

Fix for avoiding gettin Invalid schema object version when doing local...

Fix for avoiding gettin Invalid schema object version when doing local changes, more post review fixes

parent 9d667e27
...@@ -334,11 +334,15 @@ void ha_ndbcluster::no_uncommitted_rows_reset(THD *thd) ...@@ -334,11 +334,15 @@ void ha_ndbcluster::no_uncommitted_rows_reset(THD *thd)
void ha_ndbcluster::invalidate_dictionary_cache(bool global) void ha_ndbcluster::invalidate_dictionary_cache(bool global)
{ {
NDBDICT *dict= get_ndb()->getDictionary(); NDBDICT *dict= get_ndb()->getDictionary();
DBUG_ENTER("invalidate_dictionary_cache");
DBUG_PRINT("info", ("invalidating %s", m_tabname)); DBUG_PRINT("info", ("invalidating %s", m_tabname));
if (global) if (global)
{ {
if (((const NDBTAB *)m_table)->getObjectStatus() const NDBTAB *tab= dict->getTable(m_tabname);
== NdbDictionary::Object::Invalid) if (!tab)
DBUG_VOID_RETURN;
if (tab->getObjectStatus() == NdbDictionary::Object::Invalid)
{ {
// Global cache has already been invalidated // Global cache has already been invalidated
dict->removeCachedTable(m_tabname); dict->removeCachedTable(m_tabname);
...@@ -381,6 +385,7 @@ void ha_ndbcluster::invalidate_dictionary_cache(bool global) ...@@ -381,6 +385,7 @@ void ha_ndbcluster::invalidate_dictionary_cache(bool global)
break; break;
} }
} }
DBUG_VOID_RETURN;
} }
int ha_ndbcluster::ndb_err(NdbConnection *trans) int ha_ndbcluster::ndb_err(NdbConnection *trans)
...@@ -815,7 +820,6 @@ int ha_ndbcluster::get_metadata(const char *path) ...@@ -815,7 +820,6 @@ int ha_ndbcluster::get_metadata(const char *path)
if (!invalidating_ndb_table) if (!invalidating_ndb_table)
{ {
DBUG_PRINT("info", ("Invalidating table")); DBUG_PRINT("info", ("Invalidating table"));
m_table= (void *) tab;
invalidate_dictionary_cache(TRUE); invalidate_dictionary_cache(TRUE);
invalidating_ndb_table= TRUE; invalidating_ndb_table= TRUE;
} }
......
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