diff --git a/storage/ndb/src/ndbapi/DictCache.cpp b/storage/ndb/src/ndbapi/DictCache.cpp
index 43913d6c5be4e813ec04f0419ea11c0816e1fedc..47e48974449d57c9c5f8213a9cb5e45e6943bcc9 100644
--- a/storage/ndb/src/ndbapi/DictCache.cpp
+++ b/storage/ndb/src/ndbapi/DictCache.cpp
@@ -134,8 +134,8 @@ void GlobalDictCache::printCache()
       const unsigned sz = vers->size();
       for(unsigned i = 0; i<sz ; i++){
         TableVersion tv= (*vers)[i];
-        DBUG_PRINT("  ", ("vers[%d]: ver: %d, refCount: %d, status: %d",
-                          sz, tv.m_version, tv.m_refCount, tv.m_status));
+        DBUG_PRINT("  ", ("impl: %p  vers[%d]: ver: %d, refCount: %d, status: %d",
+                          tv.m_impl, i, tv.m_version, tv.m_refCount, tv.m_status));
         if(tv.m_impl != 0)
         {
           DBUG_PRINT("  ", ("m_impl: internalname: %s",
diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index 104d2ffc8bbea2978942f28e7bfd1e7810ca1e0f..5a842d1ecc550102a3ab38bccaa1c19734e61b7c 100644
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -3725,9 +3725,12 @@ NdbDictionaryImpl::getEvent(const char * eventName, NdbTableImpl* tab)
         DBUG_RETURN(NULL);
       }
     }
+    ev->setTable(tab);
+    releaseTableGlobal(*tab, 0);
   }
-
-  ev->setTable(tab);
+  else
+    ev->setTable(tab);
+  tab = 0;
 
   ev->setTable(m_ndb.externalizeTableName(ev->getTableName()));  
   // get the columns from the attrListBitmask