Commit 1cedcdd2 authored by unknown's avatar unknown
Browse files

ndb - rbr blobs: fixes (not final)


storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  invalidate table=>invalidate blob tables
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
  invalidate table=>invalidate blob tables
storage/ndb/src/ndbapi/DictCache.cpp:
  DBUG_PRINT
sql/ha_ndbcluster.cc:
  avoid discovering NDB$BLOB tables
mysql-test/t/disabled.def:
  rpl_ndb_blob passes again
parent f9b94301
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -43,6 +43,6 @@ rpl_sp : Bug#16456
rpl_until               : Unstable test case, bug#15886
sp-goto                 : GOTO is currently is disabled - will be fixed in the future
subselect               : Bug#15706 (ps mode) [PATCH PENDING]
rpl_ndb_blob            : Bug #17505
#rpl_ndb_blob            : Bug #17505
rpl_ndb_blob2           : Bug #17505
rpl_ndb_log             : results are not deterministic
+2 −2
Original line number Diff line number Diff line
@@ -5525,7 +5525,7 @@ int ndbcluster_find_all_files(THD *thd)
    {
      NDBDICT::List::Element& elmt= list.elements[i];
      int do_handle_table= 0;
      if (IS_TMP_PREFIX(elmt.name))
      if (IS_TMP_PREFIX(elmt.name) || IS_NDB_BLOB_PREFIX(elmt.name))
      {
        DBUG_PRINT("info", ("Skipping %s.%s in NDB", elmt.database, elmt.name));
        continue;
@@ -5662,7 +5662,7 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
  for (i= 0 ; i < list.count ; i++)
  {
    NDBDICT::List::Element& elmt= list.elements[i];
    if (IS_TMP_PREFIX(elmt.name))
    if (IS_TMP_PREFIX(elmt.name) || IS_NDB_BLOB_PREFIX(elmt.name))
    {
      DBUG_PRINT("info", ("Skipping %s.%s in NDB", elmt.database, elmt.name));
      continue;
+14 −2
Original line number Diff line number Diff line
@@ -159,11 +159,16 @@ GlobalDictCache::get(const char * name)
    switch(ver->m_status){
    case OK:
      ver->m_refCount++;
      DBUG_PRINT("info", ("Table OK version=%x.%x refCount=%u",
                           ver->m_impl->m_version & 0xFFFFFF,
                           ver->m_impl->m_version >> 24,
                           ver->m_refCount));
      DBUG_RETURN(ver->m_impl);
    case DROPPED:
      retreive = true; // Break loop
      break;
    case RETREIVING:
      DBUG_PRINT("info", ("Wait for retrieving thread"));
      NdbCondition_WaitTimeout(m_waitForTableCondition, m_mutex, waitTime);
      continue;
    }
@@ -178,6 +183,7 @@ GlobalDictCache::get(const char * name)
  tmp.m_status = RETREIVING;
  tmp.m_refCount = 1; // The one retreiving it
  versions->push_back(tmp);
  DBUG_PRINT("info", ("No table found"));
  DBUG_RETURN(0);
}

@@ -185,8 +191,11 @@ NdbTableImpl *
GlobalDictCache::put(const char * name, NdbTableImpl * tab)
{
  DBUG_ENTER("GlobalDictCache::put");
  DBUG_PRINT("enter", ("name: %s, internal_name: %s",
                       name, tab ? tab->m_internalName.c_str() : "tab NULL"));
  DBUG_PRINT("enter", ("name: %s, internal_name: %s version: %x.%x",
                       name,
                       tab ? tab->m_internalName.c_str() : "tab NULL",
                       tab ? tab->m_version & 0xFFFFFF : 0,
                       tab ? tab->m_version >> 24 : 0));

  const Uint32 len = strlen(name);
  Vector<TableVersion> * vers = m_tableHash.getData(name, len);
@@ -218,12 +227,14 @@ GlobalDictCache::put(const char * name, NdbTableImpl * tab)
    vers->erase(sz - 1);
  } 
  else if (ver.m_impl == 0) {
    DBUG_PRINT("info", ("Table OK"));
    ver.m_impl = tab;
    ver.m_version = tab->m_version;
    ver.m_status = OK;
  } 
  else if (ver.m_impl == &f_invalid_table) 
  {
    DBUG_PRINT("info", ("Table DROPPED invalid"));
    ver.m_impl = tab;
    ver.m_version = tab->m_version;
    ver.m_status = DROPPED;
@@ -231,6 +242,7 @@ GlobalDictCache::put(const char * name, NdbTableImpl * tab)
  }
  else if(ver.m_impl == &f_altered_table)
  {
    DBUG_PRINT("info", ("Table DROPPED altered"));
    ver.m_impl = tab;
    ver.m_version = tab->m_version;
    ver.m_status = DROPPED;
+18 −4
Original line number Diff line number Diff line
@@ -2767,15 +2767,27 @@ NdbDictInterface::execDROP_TABLE_REF(NdbApiSignal * signal,
}

int
NdbDictionaryImpl::invalidateObject(NdbTableImpl & impl)
NdbDictionaryImpl::invalidateObject(NdbTableImpl & impl, bool lock)
{
  const char * internalTableName = impl.m_internalName.c_str();
  DBUG_ENTER("NdbDictionaryImpl::invalidateObject");
  DBUG_PRINT("enter", ("internal_name: %s", internalTableName));
  m_localHash.drop(internalTableName);

  if (lock)
    m_globalHash->lock();
  if (impl.m_noOfBlobs != 0) {
    for (uint i = 0; i < impl.m_columns.size(); i++) {
      NdbColumnImpl& c = *impl.m_columns[i];
      if (! c.getBlobType() || c.getPartSize() == 0)
        continue;
      assert(c.m_blobTable != NULL);
      invalidateObject(*c.m_blobTable, false);
    }
  }
  m_localHash.drop(internalTableName);
  impl.m_status = NdbDictionary::Object::Invalid;
  m_globalHash->drop(&impl);
  if (lock)
    m_globalHash->unlock();
  DBUG_RETURN(0);
}
@@ -2784,6 +2796,8 @@ int
NdbDictionaryImpl::removeCachedObject(NdbTableImpl & impl, bool lock)
{
  const char * internalTableName = impl.m_internalName.c_str();
  DBUG_ENTER("NdbDictionaryImpl::removeCachedObject");
  DBUG_PRINT("enter", ("internal_name: %s", internalTableName));

  if (lock)
    m_globalHash->lock();
@@ -2800,7 +2814,7 @@ NdbDictionaryImpl::removeCachedObject(NdbTableImpl & impl, bool lock)
  m_globalHash->release(&impl);
  if (lock)
    m_globalHash->unlock();
  return 0;
  DBUG_RETURN(0);
}

/*****************************************************************
+1 −1
Original line number Diff line number Diff line
@@ -546,7 +546,7 @@ public:
  int dropTable(const char * name);
  int dropTable(NdbTableImpl &);
  int dropBlobTables(NdbTableImpl &);
  int invalidateObject(NdbTableImpl &);
  int invalidateObject(NdbTableImpl &, bool lock = true);
  int removeCachedObject(NdbTableImpl &, bool lock = true);

  int createIndex(NdbIndexImpl &ix);