diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2004-10-21 19:02:01 +0000 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2004-10-21 19:02:01 +0000 |
commit | 63920158ced1f2b343b14b723c2f5d9a92b06e62 (patch) | |
tree | eba95bbc6b196e98a9035458df02703db497dd86 /ndb/src/kernel | |
parent | 277c84e2b12233624bdcc8f904bf86bbf9512e8e (diff) | |
download | mariadb-git-63920158ced1f2b343b14b723c2f5d9a92b06e62.tar.gz |
changed to call internal snprintf/vsnprintf
Diffstat (limited to 'ndb/src/kernel')
-rw-r--r-- | ndb/src/kernel/blocks/backup/Backup.cpp | 4 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/Restore.cpp | 12 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp | 2 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 12 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 2 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 4 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp | 12 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp | 4 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/ndbfs/Filename.cpp | 22 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/qmgr/QmgrMain.cpp | 6 | ||||
-rw-r--r-- | ndb/src/kernel/error/ErrorReporter.cpp | 10 | ||||
-rw-r--r-- | ndb/src/kernel/main.cpp | 2 | ||||
-rw-r--r-- | ndb/src/kernel/vm/ClusterConfiguration.cpp | 8 | ||||
-rw-r--r-- | ndb/src/kernel/vm/Configuration.cpp | 12 | ||||
-rw-r--r-- | ndb/src/kernel/vm/SignalCounter.hpp | 2 | ||||
-rw-r--r-- | ndb/src/kernel/vm/SimulatedBlock.cpp | 24 | ||||
-rw-r--r-- | ndb/src/kernel/vm/SimulatedBlock.hpp | 4 |
17 files changed, 71 insertions, 71 deletions
diff --git a/ndb/src/kernel/blocks/backup/Backup.cpp b/ndb/src/kernel/blocks/backup/Backup.cpp index 569b3f98faa..e6fe63d9014 100644 --- a/ndb/src/kernel/blocks/backup/Backup.cpp +++ b/ndb/src/kernel/blocks/backup/Backup.cpp @@ -1307,7 +1307,7 @@ Backup::sendCreateTrig(Signal* signal, for (int i=0; i < 3; i++) { req->setTriggerEvent(triggerEventValues[i]); - snprintf(triggerName, sizeof(triggerName), triggerNameFormat[i], + BaseString::snprintf(triggerName, sizeof(triggerName), triggerNameFormat[i], ptr.p->backupId, tabPtr.p->tableId); w.reset(); w.add(CreateTrigReq::TriggerNameKey, triggerName); @@ -1945,7 +1945,7 @@ Backup::sendDropTrig(Signal* signal, BackupRecordPtr ptr, TablePtr tabPtr) sendSignal(DBDICT_REF, GSN_DROP_TRIG_REQ, signal, DropTrigReq::SignalLength, JBB); } else { - snprintf(triggerName, sizeof(triggerName), triggerNameFormat[i], + BaseString::snprintf(triggerName, sizeof(triggerName), triggerNameFormat[i], ptr.p->backupId, tabPtr.p->tableId); w.reset(); w.add(CreateTrigReq::TriggerNameKey, triggerName); diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.cpp b/ndb/src/kernel/blocks/backup/restore/Restore.cpp index ddd955fc96c..fb3bde6bdef 100644 --- a/ndb/src/kernel/blocks/backup/restore/Restore.cpp +++ b/ndb/src/kernel/blocks/backup/restore/Restore.cpp @@ -515,7 +515,7 @@ BackupFile::setCtlFile(Uint32 nodeId, Uint32 backupId, const char * path){ m_expectedFileHeader.FileType = BackupFormat::CTL_FILE; char name[PATH_MAX]; const Uint32 sz = sizeof(name); - snprintf(name, sz, "BACKUP-%d.%d.ctl", backupId, nodeId); + BaseString::snprintf(name, sz, "BACKUP-%d.%d.ctl", backupId, nodeId); setName(path, name); } @@ -526,7 +526,7 @@ BackupFile::setDataFile(const BackupFile & bf, Uint32 no){ m_expectedFileHeader.FileType = BackupFormat::DATA_FILE; char name[PATH_MAX]; const Uint32 sz = sizeof(name); - snprintf(name, sz, "BACKUP-%d-%d.%d.Data", + BaseString::snprintf(name, sz, "BACKUP-%d-%d.%d.Data", m_expectedFileHeader.BackupId, no, m_nodeId); setName(bf.m_path, name); } @@ -538,7 +538,7 @@ BackupFile::setLogFile(const BackupFile & bf, Uint32 no){ m_expectedFileHeader.FileType = BackupFormat::LOG_FILE; char name[PATH_MAX]; const Uint32 sz = sizeof(name); - snprintf(name, sz, "BACKUP-%d.%d.log", + BaseString::snprintf(name, sz, "BACKUP-%d.%d.log", m_expectedFileHeader.BackupId, m_nodeId); setName(bf.m_path, name); } @@ -548,15 +548,15 @@ BackupFile::setName(const char * p, const char * n){ const Uint32 sz = sizeof(m_path); if(p != 0 && strlen(p) > 0){ if(p[strlen(p)-1] == '/'){ - snprintf(m_path, sz, "%s", p); + BaseString::snprintf(m_path, sz, "%s", p); } else { - snprintf(m_path, sz, "%s%s", p, "/"); + BaseString::snprintf(m_path, sz, "%s%s", p, "/"); } } else { m_path[0] = 0; } - snprintf(m_fileName, sizeof(m_fileName), "%s%s", m_path, n); + BaseString::snprintf(m_fileName, sizeof(m_fileName), "%s%s", m_path, n); debug << "Filename = " << m_fileName << endl; } diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp b/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp index fb82570b0b9..a35d9d22c65 100644 --- a/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp +++ b/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp @@ -121,7 +121,7 @@ BackupRestore::get_table(const NdbDictionary::Table* tab){ int cnt, id1, id2; char buf[256]; if((cnt = sscanf(tab->getName(), "%[^/]/%[^/]/NDB$BLOB_%d_%d", buf, buf, &id1, &id2)) == 4){ - snprintf(buf, sizeof(buf), "NDB$BLOB_%d_%d", m_new_tables[id1]->getTableId(), id2); + BaseString::snprintf(buf, sizeof(buf), "NDB$BLOB_%d_%d", m_new_tables[id1]->getTableId(), id2); m_cache.m_new_table = m_ndb->getDictionary()->getTable(buf); } else { m_cache.m_new_table = m_new_tables[tab->getTableId()]; diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index bf9e02ead30..6784724c086 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -1438,7 +1438,7 @@ void Dbdih::execREAD_NODESCONF(Signal* signal) continue; } char buf[255]; - snprintf(buf, sizeof(buf), + BaseString::snprintf(buf, sizeof(buf), "Illegal configuration change." " Initial start needs to be performed " " when changing no of storage nodes (node %d)", i); @@ -3500,7 +3500,7 @@ void Dbdih::selectMasterCandidateAndSend(Signal* signal) Uint32 count = node_groups[nodePtr.i]; if(count != 0 && count != cnoReplicas){ char buf[255]; - snprintf(buf, sizeof(buf), + BaseString::snprintf(buf, sizeof(buf), "Illegal configuration change." " Initial start needs to be performed " " when changing no of replicas (%d != %d)", @@ -8634,7 +8634,7 @@ void Dbdih::startFragment(Signal* signal, Uint32 tableId, Uint32 fragId) /* POSSIBLE TO RESTORE THE SYSTEM. */ /* --------------------------------------------------------------------- */ char buf[100]; - snprintf(buf, sizeof(buf), + BaseString::snprintf(buf, sizeof(buf), "Unable to find restorable replica for " "table: %d fragment: %d gci: %d", tableId, fragId, SYSFILE->newestRestorableGCI); @@ -12942,7 +12942,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) snprintf(buf, sizeof(buf), " Table %d Fragment %d - ", tabPtr.i, j); for(Uint32 k = 0; k < noOfReplicas; k++){ char tmp[100]; - snprintf(tmp, sizeof(tmp), "%d ", nodeOrder[k]); + BaseString::snprintf(tmp, sizeof(tmp), "%d ", nodeOrder[k]); strcat(buf, tmp); } infoEvent(buf); @@ -13158,12 +13158,12 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) replicaPtr.i = fragPtr.p->storedReplicas; do { ptrCheckGuard(replicaPtr, creplicaFileSize, replicaRecord); - snprintf(buf2, sizeof(buf2), "%s %d(on %d)=%d(%s)", + BaseString::snprintf(buf2, sizeof(buf2), "%s %d(on %d)=%d(%s)", buf, num, replicaPtr.p->procNode, replicaPtr.p->lcpIdStarted, replicaPtr.p->lcpOngoingFlag ? "Ongoing" : "Idle"); - snprintf(buf, sizeof(buf), "%s", buf2); + BaseString::snprintf(buf, sizeof(buf), "%s", buf2); num++; replicaPtr.i = replicaPtr.p->nextReplica; diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index e6a689eb8d7..cd15ad0c3b2 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -14807,7 +14807,7 @@ void Dblqh::execDEBUG_SIG(Signal* signal) tdebug = logPagePtr.p->logPageWord[0]; char buf[100]; - snprintf(buf, 100, + BaseString::snprintf(buf, 100, "Error while reading REDO log.\n" "D=%d, F=%d Mb=%d FP=%d W1=%d W2=%d", signal->theData[2], signal->theData[3], signal->theData[4], diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 3276e4e5bce..d8b3ee10532 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -6369,8 +6369,8 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck) snprintf(buf, sizeof(buf), "TC %d: %d ops:", __LINE__, apiConnectptr.i); for(Uint32 i = 0; i<TloopCount; i++){ - snprintf(buf2, sizeof(buf2), "%s %d", buf, tmp[i]); - snprintf(buf, sizeof(buf), buf2); + BaseString::snprintf(buf2, sizeof(buf2), "%s %d", buf, tmp[i]); + BaseString::snprintf(buf, sizeof(buf), buf2); } warningEvent(buf); ndbout_c(buf); diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index 568ed6c6566..089cf613b03 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -135,42 +135,42 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal) jamEntry(); switch (sysErr->errorCode){ case SystemError::StartInProgressError: - snprintf(buf, sizeof(buf), + BaseString::snprintf(buf, sizeof(buf), "Node %d killed this node because " "master start in progress error", killingNode); break; case SystemError::GCPStopDetected: - snprintf(buf, sizeof(buf), + BaseString::snprintf(buf, sizeof(buf), "Node %d killed this node because " "GCP stop was detected", killingNode); break; case SystemError::ScanfragTimeout: - snprintf(buf, sizeof(buf), + BaseString::snprintf(buf, sizeof(buf), "Node %d killed this node because " "a fragment scan timed out and could not be stopped", killingNode); break; case SystemError::ScanfragStateError: - snprintf(buf, sizeof(buf), + BaseString::snprintf(buf, sizeof(buf), "Node %d killed this node because " "the state of a fragment scan was out of sync.", killingNode); break; case SystemError::CopyFragRefError: - snprintf(buf, sizeof(buf), + BaseString::snprintf(buf, sizeof(buf), "Node %d killed this node because " "it could not copy a fragment during node restart", killingNode); break; default: - snprintf(buf, sizeof(buf), "System error %d, " + BaseString::snprintf(buf, sizeof(buf), "System error %d, " " this node was killed by node %d", sysErr->errorCode, killingNode); break; diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp index c61fccad22a..a02bfd459b3 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp @@ -119,7 +119,7 @@ AsyncFile::doStart(Uint32 nodeId, char buf[16]; numAsyncFiles++; - snprintf(buf, sizeof(buf), "AsyncFile%d", numAsyncFiles); + BaseString::snprintf(buf, sizeof(buf), "AsyncFile%d", numAsyncFiles); theStartMutexPtr = NdbMutex_Create(); theStartConditionPtr = NdbCondition_Create(); @@ -816,7 +816,7 @@ AsyncFile::rmrfReq(Request * request, char * path, bool removePath){ struct dirent * dp; while ((dp = readdir(dirp)) != NULL){ if ((strcmp(".", dp->d_name) != 0) && (strcmp("..", dp->d_name) != 0)) { - snprintf(path_add, (size_t)path_max_copy, "%s%s", + BaseString::snprintf(path_add, (size_t)path_max_copy, "%s%s", DIR_SEPARATOR, dp->d_name); if(remove((const char*)path) == 0){ path[path_len] = 0; diff --git a/ndb/src/kernel/blocks/ndbfs/Filename.cpp b/ndb/src/kernel/blocks/ndbfs/Filename.cpp index 28aa1d23df4..15158ec19ef 100644 --- a/ndb/src/kernel/blocks/ndbfs/Filename.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Filename.cpp @@ -56,7 +56,7 @@ Filename::init(Uint32 nodeid, return; } - snprintf(theFileSystemDirectory, sizeof(theFileSystemDirectory), + BaseString::snprintf(theFileSystemDirectory, sizeof(theFileSystemDirectory), "%sndb_%u_fs%s", pFileSystemPath, nodeid, DIR_SEPARATOR); strncpy(theBackupDirectory, pBackupDirPath, sizeof(theBackupDirectory)); @@ -101,7 +101,7 @@ Filename::set(BlockReference blockReference, const Uint32 P_val = FsOpenReq::v1_getP(filenumber); if (diskNo < 0xff){ - snprintf(buf, sizeof(buf), "D%d%s", diskNo, DIR_SEPARATOR); + BaseString::snprintf(buf, sizeof(buf), "D%d%s", diskNo, DIR_SEPARATOR); strcat(theName, buf); theLevelDepth++; } @@ -112,31 +112,31 @@ Filename::set(BlockReference blockReference, ERROR_SET(ecError, AFS_ERROR_PARAMETER,"","No Block Name"); return; } - snprintf(buf, sizeof(buf), "%s%s", blockName, DIR_SEPARATOR); + BaseString::snprintf(buf, sizeof(buf), "%s%s", blockName, DIR_SEPARATOR); strcat(theName, buf); theLevelDepth++; } if (table < 0xffffffff){ - snprintf(buf, sizeof(buf), "T%d%s", table, DIR_SEPARATOR); + BaseString::snprintf(buf, sizeof(buf), "T%d%s", table, DIR_SEPARATOR); strcat(theName, buf); theLevelDepth++; } if (frag < 0xffffffff){ - snprintf(buf, sizeof(buf), "F%d%s", frag, DIR_SEPARATOR); + BaseString::snprintf(buf, sizeof(buf), "F%d%s", frag, DIR_SEPARATOR); strcat(theName, buf); theLevelDepth++; } if (S_val < 0xffffffff){ - snprintf(buf, sizeof(buf), "S%d", S_val); + BaseString::snprintf(buf, sizeof(buf), "S%d", S_val); strcat(theName, buf); } if (P_val < 0xff){ - snprintf(buf, sizeof(buf), "P%d", P_val); + BaseString::snprintf(buf, sizeof(buf), "P%d", P_val); strcat(theName, buf); } @@ -147,14 +147,14 @@ Filename::set(BlockReference blockReference, const Uint32 nodeId = FsOpenReq::v2_getNodeId(filenumber); const Uint32 count = FsOpenReq::v2_getCount(filenumber); - snprintf(buf, sizeof(buf), "BACKUP%sBACKUP-%d%s", + BaseString::snprintf(buf, sizeof(buf), "BACKUP%sBACKUP-%d%s", DIR_SEPARATOR, seq, DIR_SEPARATOR); strcat(theName, buf); if(count == 0xffffffff) { - snprintf(buf, sizeof(buf), "BACKUP-%d.%d", + BaseString::snprintf(buf, sizeof(buf), "BACKUP-%d.%d", seq, nodeId); strcat(theName, buf); } else { - snprintf(buf, sizeof(buf), "BACKUP-%d-%d.%d", + BaseString::snprintf(buf, sizeof(buf), "BACKUP-%d-%d.%d", seq, count, nodeId); strcat(theName, buf); } theLevelDepth = 2; @@ -168,7 +168,7 @@ Filename::set(BlockReference blockReference, ERROR_SET(ecError, AFS_ERROR_PARAMETER,"","Invalid disk specification"); } - snprintf(buf, sizeof(buf), "D%d%s", diskNo, DIR_SEPARATOR); + BaseString::snprintf(buf, sizeof(buf), "D%d%s", diskNo, DIR_SEPARATOR); strcat(theName, buf); theLevelDepth++; } diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index 6017365a463..9c0c6e141e1 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -592,7 +592,7 @@ void Qmgr::execCM_REGCONF(Signal* signal) if (!ndbCompatible_ndb_ndb(NDB_VERSION, cmRegConf->presidentVersion)) { jam(); char buf[128]; - snprintf(buf,sizeof(buf),"incompatible version own=0x%x other=0x%x, shutting down", NDB_VERSION, cmRegConf->presidentVersion); + BaseString::snprintf(buf,sizeof(buf),"incompatible version own=0x%x other=0x%x, shutting down", NDB_VERSION, cmRegConf->presidentVersion); systemErrorLab(signal, buf); return; } @@ -1666,7 +1666,7 @@ void Qmgr::checkStartInterface(Signal* signal) } else { if(((nodePtr.p->alarmCount + 1) % 60) == 0){ char buf[100]; - snprintf(buf, sizeof(buf), + BaseString::snprintf(buf, sizeof(buf), "Failure handling of node %d has not completed in %d min." " - state = %d", nodePtr.i, @@ -2672,7 +2672,7 @@ void Qmgr::systemErrorBecauseOtherNodeFailed(Signal* signal, failReport(signal, getOwnNodeId(), (UintR)ZTRUE, FailRep::ZOWN_FAILURE); char buf[100]; - snprintf(buf, 100, + BaseString::snprintf(buf, 100, "Node was shutdown during startup because node %d failed", failedNodeId); diff --git a/ndb/src/kernel/error/ErrorReporter.cpp b/ndb/src/kernel/error/ErrorReporter.cpp index d43001ef1f5..35c99b30994 100644 --- a/ndb/src/kernel/error/ErrorReporter.cpp +++ b/ndb/src/kernel/error/ErrorReporter.cpp @@ -60,7 +60,7 @@ ErrorReporter::formatTimeStampString(){ DateTime.setTimeStamp(); - snprintf(theDateTimeString, 39, "%s %d %s %d - %s:%s:%s", + BaseString::snprintf(theDateTimeString, 39, "%s %d %s %d - %s:%s:%s", DateTime.getDayName(), DateTime.getDayOfMonth(), DateTime.getMonthName(), DateTime.getYear(), DateTime.getHour(), DateTime.getMinute(), DateTime.getSecond()); @@ -126,7 +126,7 @@ ErrorReporter::formatMessage(ErrorCategory type, processId = NdbHost_GetProcessId(); - snprintf(messptr, MESSAGE_LENGTH, + BaseString::snprintf(messptr, MESSAGE_LENGTH, "Date/Time: %s\nType of error: %s\n" "Message: %s\nFault ID: %d\nProblem data: %s" "\nObject of reference: %s\nProgramName: %s\n" @@ -157,13 +157,13 @@ ErrorReporter::handleAssert(const char* message, const char* file, int line) char refMessage[100]; #ifdef NO_EMULATED_JAM - snprintf(refMessage, 100, "file: %s lineNo: %d", + BaseString::snprintf(refMessage, 100, "file: %s lineNo: %d", file, line); #else const Uint32 blockNumber = theEmulatedJamBlockNumber; const char *blockName = getBlockName(blockNumber); - snprintf(refMessage, 100, "%s line: %d (block: %s)", + BaseString::snprintf(refMessage, 100, "%s line: %d (block: %s)", file, line, blockName); #endif WriteMessage(assert, ERR_ERROR_PRGERR, message, refMessage, @@ -178,7 +178,7 @@ ErrorReporter::handleThreadAssert(const char* message, int line) { char refMessage[100]; - snprintf(refMessage, 100, "file: %s lineNo: %d - %s", + BaseString::snprintf(refMessage, 100, "file: %s lineNo: %d - %s", file, line, message); NdbShutdown(NST_ErrorHandler); diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp index 9c25da79065..fa44704807d 100644 --- a/ndb/src/kernel/main.cpp +++ b/ndb/src/kernel/main.cpp @@ -363,6 +363,6 @@ handler_error(int signum){ g_eventLogger.info("Received signal %d. Running error handler.", signum); // restart the system char errorData[40]; - snprintf(errorData, 40, "Signal %d received", signum); + BaseString::snprintf(errorData, 40, "Signal %d received", signum); ERROR_SET_SIGNAL(fatal, 0, errorData, __FILE__); } diff --git a/ndb/src/kernel/vm/ClusterConfiguration.cpp b/ndb/src/kernel/vm/ClusterConfiguration.cpp index 3a6478380d1..d5bd03f69d5 100644 --- a/ndb/src/kernel/vm/ClusterConfiguration.cpp +++ b/ndb/src/kernel/vm/ClusterConfiguration.cpp @@ -358,7 +358,7 @@ void ClusterConfiguration::init(const Properties & p, const Properties & db){ for(int i = 0; i<sz; i++){ if(!db.get(tmp[i].attrib, tmp[i].storage)){ char buf[255]; - snprintf(buf, sizeof(buf), "%s not found", tmp[i].attrib); + BaseString::snprintf(buf, sizeof(buf), "%s not found", tmp[i].attrib); ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } } @@ -406,7 +406,7 @@ void ClusterConfiguration::init(const Properties & p, const Properties & db){ for(unsigned j = 0; j<nodeNo; j++){ if(cd.nodeData[j].nodeId == nodeId){ char buf[255]; - snprintf(buf, sizeof(buf), "Two node can not have the same node id"); + BaseString::snprintf(buf, sizeof(buf), "Two node can not have the same node id"); ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } } @@ -429,12 +429,12 @@ void ClusterConfiguration::init(const Properties & p, const Properties & db){ if(nodeId > MAX_NDB_NODES){ char buf[255]; - snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d", MAX_NDB_NODES); + BaseString::snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d", MAX_NDB_NODES); ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } if(cd.SizeAltData.noOfNDBNodes > MAX_NDB_NODES){ char buf[255]; - snprintf(buf, sizeof(buf), + BaseString::snprintf(buf, sizeof(buf), "Maximum %d ndb nodes is allowed in the cluster", MAX_NDB_NODES); ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 7fb8dbcb003..706f60fd9cf 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -487,7 +487,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ if (tmp[i].computable) { *tmp[i].storage = 0; } else { - snprintf(buf, sizeof(buf),"ConfigParam: %d not found", tmp[i].paramId); + BaseString::snprintf(buf, sizeof(buf),"ConfigParam: %d not found", tmp[i].paramId); ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } } @@ -497,12 +497,12 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ ndb_mgm_get_int64_parameter(&db, CFG_DB_DATA_MEM, &dataMem); ndb_mgm_get_int64_parameter(&db, CFG_DB_INDEX_MEM, &indexMem); if(dataMem == 0){ - snprintf(buf, sizeof(buf), "ConfigParam: %d not found", CFG_DB_DATA_MEM); + BaseString::snprintf(buf, sizeof(buf), "ConfigParam: %d not found", CFG_DB_DATA_MEM); ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } if(indexMem == 0){ - snprintf(buf, sizeof(buf), "ConfigParam: %d not found", CFG_DB_INDEX_MEM); + BaseString::snprintf(buf, sizeof(buf), "ConfigParam: %d not found", CFG_DB_INDEX_MEM); ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } @@ -535,13 +535,13 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ } if(nodeId > MAX_NODES || nodeId == 0){ - snprintf(buf, sizeof(buf), + BaseString::snprintf(buf, sizeof(buf), "Invalid node id: %d", nodeId); ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } if(nodes.get(nodeId)){ - snprintf(buf, sizeof(buf), "Two node can not have the same node id: %d", + BaseString::snprintf(buf, sizeof(buf), "Two node can not have the same node id: %d", nodeId); ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } @@ -568,7 +568,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ case NODE_TYPE_EXT_REP: break; default: - snprintf(buf, sizeof(buf), "Unknown node type: %d", nodeType); + BaseString::snprintf(buf, sizeof(buf), "Unknown node type: %d", nodeType); ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } } diff --git a/ndb/src/kernel/vm/SignalCounter.hpp b/ndb/src/kernel/vm/SignalCounter.hpp index ea770324aa6..62242cb65bd 100644 --- a/ndb/src/kernel/vm/SignalCounter.hpp +++ b/ndb/src/kernel/vm/SignalCounter.hpp @@ -151,7 +151,7 @@ const char * SignalCounter::getText() const { static char buf[255]; static char nodes[NodeBitmask::TextLength+1]; - snprintf(buf, sizeof(buf), "[SignalCounter: m_count=%d %s]", m_count, m_nodes.getText(nodes)); + BaseString::snprintf(buf, sizeof(buf), "[SignalCounter: m_count=%d %s]", m_count, m_nodes.getText(nodes)); return buf; } diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp index 18b7f474ddc..e6b97771d36 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.cpp +++ b/ndb/src/kernel/vm/SimulatedBlock.cpp @@ -68,25 +68,25 @@ SimulatedBlock::SimulatedBlock(BlockNumber blockNumber, char buf[255]; count = 10; - snprintf(buf, 255, "%s.FragmentSendPool", getBlockName(blockNumber)); + BaseString::snprintf(buf, 255, "%s.FragmentSendPool", getBlockName(blockNumber)); if(!p->get(buf, &count)) p->get("FragmentSendPool", &count); c_fragmentSendPool.setSize(count); count = 10; - snprintf(buf, 255, "%s.FragmentInfoPool", getBlockName(blockNumber)); + BaseString::snprintf(buf, 255, "%s.FragmentInfoPool", getBlockName(blockNumber)); if(!p->get(buf, &count)) p->get("FragmentInfoPool", &count); c_fragmentInfoPool.setSize(count); count = 10; - snprintf(buf, 255, "%s.FragmentInfoHash", getBlockName(blockNumber)); + BaseString::snprintf(buf, 255, "%s.FragmentInfoHash", getBlockName(blockNumber)); if(!p->get(buf, &count)) p->get("FragmentInfoHash", &count); c_fragmentInfoHash.setSize(count); count = 5; - snprintf(buf, 255, "%s.ActiveMutexes", getBlockName(blockNumber)); + BaseString::snprintf(buf, 255, "%s.ActiveMutexes", getBlockName(blockNumber)); if(!p->get(buf, &count)) p->get("ActiveMutexes", &count); c_mutexMgr.setSize(count); @@ -147,7 +147,7 @@ SimulatedBlock::addRecSignalImpl(GlobalSignalNumber gsn, ExecFunction f, bool force){ if(gsn > MAX_GSN || (!force && theExecArray[gsn] != 0)){ char errorMsg[255]; - snprintf(errorMsg, 255, + BaseString::snprintf(errorMsg, 255, "Illeagal signal (%d %d)", gsn, MAX_GSN); ERROR_SET(fatal, ERR_ERROR_PRGERR, errorMsg, errorMsg); } @@ -159,9 +159,9 @@ SimulatedBlock::signal_error(Uint32 gsn, Uint32 len, Uint32 recBlockNo, const char* filename, int lineno) const { char objRef[255]; - snprintf(objRef, 255, "%s:%d", filename, lineno); + BaseString::snprintf(objRef, 255, "%s:%d", filename, lineno); char probData[255]; - snprintf(probData, 255, + BaseString::snprintf(probData, 255, "Signal (GSN: %d, Length: %d, Rec Block No: %d)", gsn, len, recBlockNo); @@ -664,9 +664,9 @@ SimulatedBlock::allocRecord(const char * type, size_t s, size_t n, bool clear) if (p == NULL){ char buf1[255]; char buf2[255]; - snprintf(buf1, sizeof(buf1), "%s could not allocate memory for %s", + BaseString::snprintf(buf1, sizeof(buf1), "%s could not allocate memory for %s", getBlockName(number()), type); - snprintf(buf2, sizeof(buf2), "Requested: %ux%u = %u bytes", + BaseString::snprintf(buf2, sizeof(buf2), "Requested: %ux%u = %u bytes", (Uint32)s, (Uint32)n, (Uint32)size); ERROR_SET(fatal, ERR_MEMALLOC, buf1, buf2); } @@ -722,7 +722,7 @@ SimulatedBlock::progError(int line, int err_code, const char* extra) const { /* Add line number to block name */ char buf[100]; - snprintf(&buf[0], 100, "%s (Line: %d) 0x%.8x", + BaseString::snprintf(&buf[0], 100, "%s (Line: %d) 0x%.8x", aBlockName, line, magicStatus); ErrorReporter::handleError(ecError, err_code, extra, buf); @@ -740,7 +740,7 @@ SimulatedBlock::infoEvent(const char * msg, ...) const { va_list ap; va_start(ap, msg); - vsnprintf(buf, 96, msg, ap); // 96 = 100 - 4 + BaseString::vsnprintf(buf, 96, msg, ap); // 96 = 100 - 4 va_end(ap); int len = strlen(buf) + 1; @@ -781,7 +781,7 @@ SimulatedBlock::warningEvent(const char * msg, ...) const { va_list ap; va_start(ap, msg); - vsnprintf(buf, 96, msg, ap); // 96 = 100 - 4 + BaseString::vsnprintf(buf, 96, msg, ap); // 96 = 100 - 4 va_end(ap); int len = strlen(buf) + 1; diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp index 6d46e9cc377..7972cb39746 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -472,11 +472,11 @@ SimulatedBlock::executeFunction(GlobalSignalNumber gsn, Signal* signal){ */ char errorMsg[255]; if (!(gsn <= MAX_GSN)) { - snprintf(errorMsg, 255, "Illegal signal received (GSN %d too high)", gsn); + BaseString::snprintf(errorMsg, 255, "Illegal signal received (GSN %d too high)", gsn); ERROR_SET(fatal, ERR_ERROR_PRGERR, errorMsg, errorMsg); } if (!(theExecArray[gsn] != 0)) { - snprintf(errorMsg, 255, "Illegal signal received (GSN %d not added)", gsn); + BaseString::snprintf(errorMsg, 255, "Illegal signal received (GSN %d not added)", gsn); ERROR_SET(fatal, ERR_ERROR_PRGERR, errorMsg, errorMsg); } ndbrequire(false); |