Commit 140c3b8a authored by unknown's avatar unknown
Browse files

ndb - rbr blobs etc: minor changes bug#17045 bug#17505


sql/ha_ndbcluster_binlog.cc:
  optim: setting db/schema for data events seems unnecessary
storage/ndb/src/ndbapi/Ndb.cpp:
  use NAME_LEN
parent c8a03c17
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -2913,17 +2913,19 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
            DBUG_ASSERT(share != 0);
          }
#endif
          // set injector_ndb database/schema from table internal name
          int ret= ndb->setDatabaseAndSchemaName(pOp->getEvent()->getTable());
          assert(ret == 0);
          if ((unsigned) pOp->getEventType() <
              (unsigned) NDBEVENT::TE_FIRST_NON_DATA_EVENT)
            ndb_binlog_thread_handle_data_event(ndb, pOp, row, trans);
          else
          {
            // set injector_ndb database/schema from table internal name
            int ret= ndb->setDatabaseAndSchemaName(pOp->getEvent()->getTable());
            assert(ret == 0);
            ndb_binlog_thread_handle_non_data_event(ndb, pOp, row);
            // reset to catch errors
            ndb->setDatabaseName("");
            ndb->setDatabaseSchemaName("");
          }

          pOp= ndb->nextEvent();
        } while (pOp && pOp->getGCI() == gci);
+8 −6
Original line number Diff line number Diff line
@@ -1093,7 +1093,8 @@ int Ndb::setDatabaseAndSchemaName(const NdbDictionary::Table* t)
  if (s1 && s1 != s0) {
    const char* s2 = strchr(s1 + 1, table_name_separator);
    if (s2 && s2 != s1 + 1) {
      char buf[200];
      char buf[NAME_LEN + 1];
      if (s1 - s0 <= NAME_LEN && s2 - (s1 + 1) <= NAME_LEN) {
        sprintf(buf, "%.*s", s1 - s0, s0);
        setDatabaseName(buf);
        sprintf(buf, "%.*s", s2 - (s1 + 1), s1 + 1);
@@ -1101,6 +1102,7 @@ int Ndb::setDatabaseAndSchemaName(const NdbDictionary::Table* t)
        return 0;
      }
    }
  }
  return -1;
}