Exemple #1
0
void PackedVersion::print(raw_ostream &OS) const {
  OS << format("%d", getMajor());
  if (getMinor() || getSubminor())
    OS << format(".%d", getMinor());
  if (getSubminor())
    OS << format(".%d", getSubminor());
}
Exemple #2
0
const char * ndbGetVersionString(Uint32 version, Uint32 mysql_version,
                                 const char * status,
                                 char *buf, unsigned sz)
{
    char tmp[NDB_VERSION_STRING_BUF_SZ];
    if (status && status[0] != 0)
        basestring_snprintf(tmp, sizeof(tmp), "%s", status);
    else
        tmp[0] = 0;

    if (mysql_version)
    {
        basestring_snprintf(buf, sz, "mysql-%d.%d.%d ndb-%d.%d.%d%s",
                            getMajor(mysql_version),
                            getMinor(mysql_version),
                            getBuild(mysql_version),
                            getMajor(version),
                            getMinor(version),
                            getBuild(version),
                            tmp);
    }
    else
    {
        basestring_snprintf(buf, sz, "ndb-%d.%d.%d%s",
                            getMajor(version),
                            getMinor(version),
                            getBuild(version),
                            tmp);
    }
    return buf;
}
Exemple #3
0
static
void
ndbPrintCompatibleTable(struct NdbUpGradeCompatible table[])
{
    int i;
    printf("ownVersion, matchType, otherVersion\n");
    for (i = 0; table[i].ownVersion != 0 && table[i].otherVersion != 0; i++) {

        printf("%u.%u.%u, ",
               getMajor(table[i].ownVersion),
               getMinor(table[i].ownVersion),
               getBuild(table[i].ownVersion));
        switch (table[i].matchType) {
        case UG_Range:
            printf("Range");
            break;
        case UG_Exact:
            printf("Exact");
            break;
        default:
            break;
        }
        printf(", %u.%u.%u\n",
               getMajor(table[i].otherVersion),
               getMinor(table[i].otherVersion),
               getBuild(table[i].otherVersion));

    }
    printf("\n");
}
Exemple #4
0
void
ClusterMgr::execAPI_REGREQ(const Uint32 * theData){
  const ApiRegReq * const apiRegReq = (ApiRegReq *)&theData[0];
  const NodeId nodeId = refToNode(apiRegReq->ref);

#ifdef DEBUG_REG
  ndbout_c("ClusterMgr: Recd API_REGREQ from node %d", nodeId);
#endif

  assert(nodeId > 0 && nodeId < MAX_NODES);

  Node & cm_node = theNodes[nodeId];
  trp_node & node = cm_node;
  assert(node.defined == true);
  assert(node.is_connected() == true);

  if(node.m_info.m_version != apiRegReq->version){
    node.m_info.m_version = apiRegReq->version;
    node.m_info.m_mysql_version = apiRegReq->mysql_version;
    if (node.m_info.m_version < NDBD_SPLIT_VERSION)
      node.m_info.m_mysql_version = 0;

    if (getMajor(node.m_info.m_version) < getMajor(NDB_VERSION) ||
	getMinor(node.m_info.m_version) < getMinor(NDB_VERSION)) {
      node.compatible = false;
    } else {
      node.compatible = true;
    }
  }

  NdbApiSignal signal(numberToRef(API_CLUSTERMGR, theFacade.ownId()));
  signal.theVerId_signalNumber   = GSN_API_REGCONF;
  signal.theReceiversBlockNumber = API_CLUSTERMGR;
  signal.theTrace                = 0;
  signal.theLength               = ApiRegConf::SignalLength;
  
  ApiRegConf * const conf = CAST_PTR(ApiRegConf, signal.getDataPtrSend());
  conf->qmgrRef = numberToRef(API_CLUSTERMGR, theFacade.ownId());
  conf->version = NDB_VERSION;
  conf->mysql_version = NDB_MYSQL_VERSION_D;
  conf->apiHeartbeatFrequency = cm_node.hbFrequency;

  conf->minDbVersion= 0;
  conf->nodeState= node.m_state;

  node.set_confirmed(true);
  if (safe_sendSignal(&signal, nodeId) != 0)
    node.set_confirmed(false);
}
Exemple #5
0
void ndbPrintVersion()
{
  printf("Version: %u.%u.%u\n",
	 getMajor(ndbGetOwnVersion()),
	 getMinor(ndbGetOwnVersion()),
	 getBuild(ndbGetOwnVersion()));
}
void getTextConnectedApiVersion(QQQQ) {
  BaseString::snprintf(m_text, m_text_len, 
		       "Node %u: API version %d.%d.%d",
		       theData[1],
		       getMajor(theData[2]),
		       getMinor(theData[2]),
		       getBuild(theData[2]));
}
Exemple #7
0
const char * ndbGetVersionString(Uint32 version, const char * status,
                                 char *buf, unsigned sz)
{
  if (status && status[0] != 0)
	  basestring_snprintf(buf, sz,
	     "Version %d.%d.%d (%s)",
	     getMajor(version),
	     getMinor(version),
	     getBuild(version),
	     status);
  else
    basestring_snprintf(buf, sz,
	     "Version %d.%d.%d",
	     getMajor(version),
	     getMinor(version),
	     getBuild(version));
  return buf;
}
void
MgmApiSession::getVersion(Parser<MgmApiSession>::Context &,
			  Properties const &) {
  m_output->println("version");
  m_output->println("id: %d", NDB_VERSION);
  m_output->println("major: %d", getMajor(NDB_VERSION));
  m_output->println("minor: %d", getMinor(NDB_VERSION));
  m_output->println("string: %s", NDB_VERSION_STRING);
  m_output->println("");
}
void getTextNDBStartStarted(QQQQ) {
  //-----------------------------------------------------------------------
  // Start of NDB has been initiated.
  //-----------------------------------------------------------------------
  BaseString::snprintf(m_text, m_text_len, 
		       "Start initiated (version %d.%d.%d)", 
		       getMajor(theData[1]),
		       getMinor(theData[1]),
		       getBuild(theData[1]));
}
Exemple #10
0
inline
bool
isDrop6(Uint32 version)
{
  return (getMajor(version) == 5 && getMinor(version) == 2);
}
QList<QVariant> Version::toArray()
{
   return {getMajor(), getMinor(), getPatch(), getBuild(), getRelease()};
}