summaryrefslogtreecommitdiff
path: root/ndb/src
diff options
context:
space:
mode:
authorunknown <ndbdev@eel.hemma.oreland.se>2004-08-05 22:19:52 +0200
committerunknown <ndbdev@eel.hemma.oreland.se>2004-08-05 22:19:52 +0200
commite223c07eb18147b809cb885ca267ca43f4870701 (patch)
tree682d9074ab3a5be1182ff2e58fe002059f0ddca1 /ndb/src
parent22306d0590f21ed8a43e92cee8fe591df4e88fe2 (diff)
parentebe79c0b9bbb7bf03cd0ed15e474fed6d74adbff (diff)
downloadmariadb-git-e223c07eb18147b809cb885ca267ca43f4870701.tar.gz
Merge joreland@bk-internal.mysql.com:irix
into eel.hemma.oreland.se:/ndb/clone-mysql-4.1-ndb-daily-2004-08-04 BitKeeper/etc/logging_ok: auto-union ndb/src/common/debugger/signaldata/SignalDataPrint.cpp: Auto merged ndb/src/cw/cpcd/Process.cpp: Auto merged ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Auto merged ndb/src/kernel/blocks/dbtux/Dbtux.hpp: Auto merged ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp: Auto merged ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp: Auto merged ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged ndb/test/ndbapi/testBasic.cpp: Auto merged ndb/test/run-test/main.cpp: Auto merged ndb/test/src/HugoTransactions.cpp: Auto merged sql/ha_ndbcluster.cc: Auto merged
Diffstat (limited to 'ndb/src')
-rw-r--r--ndb/src/common/debugger/DebuggerNames.cpp15
-rw-r--r--ndb/src/common/debugger/EventLogger.cpp5
-rw-r--r--ndb/src/common/debugger/SignalLoggerManager.cpp25
-rw-r--r--ndb/src/common/debugger/signaldata/LCP.cpp3
-rw-r--r--ndb/src/common/debugger/signaldata/SignalDataPrint.cpp8
-rw-r--r--ndb/src/common/logger/Logger.cpp1
-rw-r--r--ndb/src/common/mgmcommon/ConfigInfo.cpp23
-rw-r--r--ndb/src/common/transporter/Packer.cpp14
-rw-r--r--ndb/src/common/transporter/TransporterRegistry.cpp12
-rw-r--r--ndb/src/common/util/BaseString.cpp3
-rw-r--r--ndb/src/common/util/ConfigValues.cpp18
-rw-r--r--ndb/src/common/util/Parser.cpp1
-rw-r--r--ndb/src/common/util/Properties.cpp6
-rw-r--r--ndb/src/common/util/SocketServer.cpp13
-rw-r--r--ndb/src/cw/cpcd/CPCD.cpp5
-rw-r--r--ndb/src/cw/cpcd/Process.cpp8
-rw-r--r--ndb/src/kernel/blocks/backup/Backup.cpp5
-rw-r--r--ndb/src/kernel/blocks/backup/BackupInit.cpp3
-rw-r--r--ndb/src/kernel/blocks/backup/restore/Restore.cpp15
-rw-r--r--ndb/src/kernel/blocks/backup/restore/Restore.hpp5
-rw-r--r--ndb/src/kernel/blocks/backup/restore/main.cpp8
-rw-r--r--ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp22
-rw-r--r--ndb/src/kernel/blocks/dbacc/DbaccMain.cpp4
-rw-r--r--ndb/src/kernel/blocks/dbdict/Dbdict.cpp26
-rw-r--r--ndb/src/kernel/blocks/dbdih/DbdihInit.cpp7
-rw-r--r--ndb/src/kernel/blocks/dbdih/DbdihMain.cpp83
-rw-r--r--ndb/src/kernel/blocks/dblqh/DblqhMain.cpp21
-rw-r--r--ndb/src/kernel/blocks/dbtc/DbtcMain.cpp6
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp5
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp12
-rw-r--r--ndb/src/kernel/blocks/dbtux/Dbtux.hpp2
-rw-r--r--ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp5
-rw-r--r--ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp5
-rw-r--r--ndb/src/kernel/blocks/dbutil/DbUtil.cpp2
-rw-r--r--ndb/src/kernel/blocks/grep/Grep.cpp7
-rw-r--r--ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp2
-rw-r--r--ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp3
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp3
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Pool.hpp1
-rw-r--r--ndb/src/kernel/blocks/qmgr/QmgrMain.cpp5
-rw-r--r--ndb/src/kernel/blocks/suma/Suma.cpp3
-rw-r--r--ndb/src/kernel/blocks/trix/Trix.cpp2
-rw-r--r--ndb/src/kernel/error/ErrorReporter.hpp29
-rw-r--r--ndb/src/kernel/main.cpp16
-rw-r--r--ndb/src/kernel/vm/ArrayPool.hpp2
-rw-r--r--ndb/src/kernel/vm/DataBuffer.hpp2
-rw-r--r--ndb/src/kernel/vm/MetaData.cpp2
-rw-r--r--ndb/src/kernel/vm/SimulatedBlock.cpp16
-rw-r--r--ndb/src/kernel/vm/SimulatedBlock.hpp4
-rw-r--r--ndb/src/kernel/vm/TransporterCallback.cpp25
-rw-r--r--ndb/src/mgmapi/mgmapi.cpp9
-rw-r--r--ndb/src/mgmclient/CommandInterpreter.cpp25
-rw-r--r--ndb/src/mgmclient/CpcClient.cpp3
-rw-r--r--ndb/src/mgmsrv/CommandInterpreter.cpp12
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.cpp32
-rw-r--r--ndb/src/mgmsrv/Services.cpp5
-rw-r--r--ndb/src/ndbapi/DictCache.cpp11
-rw-r--r--ndb/src/ndbapi/Ndb.cpp8
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.cpp36
-rw-r--r--ndb/src/ndbapi/NdbEventOperationImpl.cpp12
-rw-r--r--ndb/src/ndbapi/NdbLinHash.hpp12
-rw-r--r--ndb/src/ndbapi/NdbScanFilter.cpp9
-rw-r--r--ndb/src/ndbapi/Ndbinit.cpp5
-rw-r--r--ndb/src/ndbapi/TransporterFacade.cpp30
64 files changed, 410 insertions, 317 deletions
diff --git a/ndb/src/common/debugger/DebuggerNames.cpp b/ndb/src/common/debugger/DebuggerNames.cpp
index ebe94a6059f..2142138e435 100644
--- a/ndb/src/common/debugger/DebuggerNames.cpp
+++ b/ndb/src/common/debugger/DebuggerNames.cpp
@@ -29,10 +29,11 @@ static const char * localBlockNames[NO_OF_BLOCKS];
static
int
initSignalNames(const char * dst[], const GsnName src[], unsigned short len){
- for(int i = 0; i<=MAX_GSN; i++)
+ int i;
+ for(i = 0; i<=MAX_GSN; i++)
dst[i] = 0;
- for(int i = 0; i<len; i++){
+ for(i = 0; i<len; i++){
unsigned short gsn = src[i].gsn;
const char * name = src[i].name;
@@ -54,10 +55,11 @@ int
initSignalPrinters(SignalDataPrintFunction dst[],
const NameFunctionPair src[],
unsigned short len){
- for(int i = 0; i<=MAX_GSN; i++)
+ int i;
+ for(i = 0; i<=MAX_GSN; i++)
dst[i] = 0;
- for(int i = 0; i<len; i++){
+ for(i = 0; i<len; i++){
unsigned short gsn = src[i].gsn;
SignalDataPrintFunction fun = src[i].function;
@@ -79,10 +81,11 @@ int
initBlockNames(const char * dst[],
const BlockName src[],
unsigned len){
- for(int i = 0; i<NO_OF_BLOCKS; i++)
+ int i;
+ for(i = 0; i<NO_OF_BLOCKS; i++)
dst[i] = 0;
- for(unsigned i = 0; i<len; i++){
+ for(i = 0; i<len; i++){
const int index = src[i].number - MIN_BLOCK_NO;
if(index < 0 && index >= NO_OF_BLOCKS || dst[index] != 0){
fprintf(stderr,
diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp
index 3bf82f6fb5d..50c3b778731 100644
--- a/ndb/src/common/debugger/EventLogger.cpp
+++ b/ndb/src/common/debugger/EventLogger.cpp
@@ -1303,14 +1303,15 @@ bool
EventLogger::matchEventCategory(const char * str,
LogLevel::EventCategory * cat,
bool exactMatch){
+ unsigned i;
if(cat == 0 || str == 0)
return false;
char * tmp = strdup(str);
- for(size_t i = 0; i<strlen(tmp); i++)
+ for(i = 0; i<strlen(tmp); i++)
tmp[i] = toupper(tmp[i]);
- for(Uint32 i = 0; i<noOfEventCategoryNames; i++){
+ for(i = 0; i<noOfEventCategoryNames; i++){
if(strcmp(tmp, eventCategoryNames[i].name) == 0){
* cat = eventCategoryNames[i].category;
free(tmp);
diff --git a/ndb/src/common/debugger/SignalLoggerManager.cpp b/ndb/src/common/debugger/SignalLoggerManager.cpp
index 3839a348222..d642ed09a68 100644
--- a/ndb/src/common/debugger/SignalLoggerManager.cpp
+++ b/ndb/src/common/debugger/SignalLoggerManager.cpp
@@ -488,31 +488,6 @@ SignalLoggerManager::printLinearSection(FILE * output,
}
void
-SignalLoggerManager::printSegmentedSection(FILE * output,
- const SignalHeader & sh,
- const SegmentedSectionPtr ptr[3],
- unsigned i)
-{
- fprintf(output, "SECTION %u type=segmented", i);
- if (i >= 3) {
- fprintf(output, " *** invalid ***\n");
- return;
- }
- const Uint32 len = ptr[i].sz;
- SectionSegment * ssp = ptr[i].p;
- Uint32 pos = 0;
- fprintf(output, " size=%u\n", (unsigned)len);
- while (pos < len) {
- if (pos > 0 && pos % SectionSegment::DataLength == 0) {
- ssp = g_sectionSegmentPool.getPtr(ssp->m_nextSegment);
- }
- printDataWord(output, pos, ssp->theData[pos % SectionSegment::DataLength]);
- }
- if (len > 0)
- putc('\n', output);
-}
-
-void
SignalLoggerManager::printDataWord(FILE * output, Uint32 & pos, const Uint32 data)
{
const char* const hex = "0123456789abcdef";
diff --git a/ndb/src/common/debugger/signaldata/LCP.cpp b/ndb/src/common/debugger/signaldata/LCP.cpp
index 825659d13b3..6b4bb13e2cd 100644
--- a/ndb/src/common/debugger/signaldata/LCP.cpp
+++ b/ndb/src/common/debugger/signaldata/LCP.cpp
@@ -25,7 +25,8 @@ printSTART_LCP_REQ(FILE * output, const Uint32 * theData,
const StartLcpReq * const sig = (StartLcpReq *) theData;
- char buf1[sig->participatingDIH.TextLength+1], buf2[sig->participatingLQH.TextLength+1];
+ char buf1[8*_NDB_NODE_BITMASK_SIZE+1];
+ char buf2[8*_NDB_NODE_BITMASK_SIZE+1];
fprintf(output,
" Sender: %d LcpId: %d\n"
" ParticipatingDIH = %s\n"
diff --git a/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp b/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
index e18ca18b632..65351663789 100644
--- a/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
+++ b/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
@@ -254,5 +254,9 @@ SignalDataPrintFunctions[] = {
const unsigned short NO_OF_PRINT_FUNCTIONS = sizeof(SignalDataPrintFunctions)/sizeof(NameFunctionPair);
-
-
+template class Bitmask<1>;
+template class Bitmask<2>;
+template class Bitmask<4>;
+template struct BitmaskPOD<1>;
+template struct BitmaskPOD<2>;
+template struct BitmaskPOD<4>;
diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp
index 9c9f1eece18..c2fdecb642b 100644
--- a/ndb/src/common/logger/Logger.cpp
+++ b/ndb/src/common/logger/Logger.cpp
@@ -350,3 +350,4 @@ Logger::log(LoggerLevel logLevel, const char* pMsg, va_list ap) const
// PRIVATE
//
+template class Vector<LogHandler*>;
diff --git a/ndb/src/common/mgmcommon/ConfigInfo.cpp b/ndb/src/common/mgmcommon/ConfigInfo.cpp
index 89280aa80e8..6076b56de04 100644
--- a/ndb/src/common/mgmcommon/ConfigInfo.cpp
+++ b/ndb/src/common/mgmcommon/ConfigInfo.cpp
@@ -1878,13 +1878,14 @@ const int ConfigInfo::m_NoOfParams = sizeof(m_ParamInfo) / sizeof(ParamInfo);
static void require(bool v) { if(!v) abort();}
ConfigInfo::ConfigInfo() {
+ int i;
Properties *section;
const Properties *oldpinfo;
m_info.setCaseInsensitiveNames(true);
m_systemDefaults.setCaseInsensitiveNames(true);
- for (int i=0; i<m_NoOfParams; i++) {
+ for (i=0; i<m_NoOfParams; i++) {
const ParamInfo & param = m_ParamInfo[i];
// Create new section if it did not exist
@@ -1939,7 +1940,7 @@ ConfigInfo::ConfigInfo() {
}
}
- for (int i=0; i<m_NoOfParams; i++) {
+ for (i=0; i<m_NoOfParams; i++) {
if(m_ParamInfo[i]._section == NULL){
ndbout << "Check that each entry has a section failed." << endl;
ndbout << "Parameter \"" << m_ParamInfo[i]._fname << endl;
@@ -2777,13 +2778,14 @@ transform(InitConfigFileParser::Context & ctx,
bool
fixDepricated(InitConfigFileParser::Context & ctx, const char * data){
+ const char * name;
/**
* Transform old values to new values
* Transform new values to old values (backward compatible)
*/
Properties tmp;
Properties::Iterator it(ctx.m_currentSection);
- for (const char* name = it.first(); name != NULL; name = it.next()) {
+ for (name = it.first(); name != NULL; name = it.next()) {
const DepricationTransform * p = &f_deprication[0];
while(p->m_section != 0){
if(strcmp(p->m_section, ctx.fname) == 0){
@@ -2804,7 +2806,7 @@ fixDepricated(InitConfigFileParser::Context & ctx, const char * data){
}
Properties::Iterator it2(&tmp);
- for (const char* name = it2.first(); name != NULL; name = it2.next()) {
+ for (name = it2.first(); name != NULL; name = it2.next()) {
PropertiesType type;
require(tmp.getTypeOf(name, &type));
switch(type){
@@ -2910,11 +2912,12 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
struct InitConfigFileParser::Context &ctx,
const char * rule_data)
{
+ Uint32 i;
Properties * props= ctx.m_config;
Properties p_connections;
Properties p_connections2;
- for (Uint32 i = 0;; i++){
+ for (i = 0;; i++){
const Properties * tmp;
Uint32 nodeId1, nodeId2;
@@ -2935,8 +2938,8 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
Properties p_db_nodes;
Properties p_api_mgm_nodes;
- Uint32 i_db= 0, i_api_mgm= 0;
- for (Uint32 i= 0, n= 0; n < nNodes; i++){
+ Uint32 i_db= 0, i_api_mgm= 0, n;
+ for (i= 0, n= 0; n < nNodes; i++){
const Properties * tmp;
if(!props->get("Node", i, &tmp)) continue;
n++;
@@ -2953,7 +2956,7 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
Uint32 nodeId1, nodeId2, dummy;
- for (Uint32 i= 0; p_db_nodes.get("", i, &nodeId1); i++){
+ for (i= 0; p_db_nodes.get("", i, &nodeId1); i++){
for (Uint32 j= i+1;; j++){
if(!p_db_nodes.get("", j, &nodeId2)) break;
if(!p_connections2.get("", nodeId1+nodeId2<<16, &dummy)) {
@@ -2970,7 +2973,7 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
}
}
- for (Uint32 i= 0; p_api_mgm_nodes.get("", i, &nodeId1); i++){
+ for (i= 0; p_api_mgm_nodes.get("", i, &nodeId1); i++){
if(!p_connections.get("", nodeId1, &dummy)) {
for (Uint32 j= 0;; j++){
if(!p_db_nodes.get("", j, &nodeId2)) break;
@@ -2989,6 +2992,7 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
return true;
}
+
bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>&sections,
struct InitConfigFileParser::Context &ctx,
const char * rule_data)
@@ -3028,3 +3032,4 @@ bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>&sections,
return true;
}
+template class Vector<ConfigInfo::ConfigRuleSection>;
diff --git a/ndb/src/common/transporter/Packer.cpp b/ndb/src/common/transporter/Packer.cpp
index fa72af12dac..645517a4b1a 100644
--- a/ndb/src/common/transporter/Packer.cpp
+++ b/ndb/src/common/transporter/Packer.cpp
@@ -391,6 +391,7 @@ Packer::pack(Uint32 * insertPtr,
const SignalHeader * header,
const Uint32 * theData,
const LinearSectionPtr ptr[3]) const {
+ Uint32 i;
Uint32 dataLen32 = header->theLength;
Uint32 no_segs = header->m_noOfSections;
@@ -400,7 +401,7 @@ Packer::pack(Uint32 * insertPtr,
checksumUsed + signalIdUsed + (sizeof(Protocol6)/4);
- for(Uint32 i = 0; i<no_segs; i++){
+ for(i = 0; i<no_segs; i++){
len32 += ptr[i].sz;
}
@@ -429,12 +430,12 @@ Packer::pack(Uint32 * insertPtr,
memcpy(tmpInserPtr, theData, 4 * dataLen32);
tmpInserPtr += dataLen32;
- for(Uint32 i = 0; i<no_segs; i++){
+ for(i = 0; i<no_segs; i++){
tmpInserPtr[i] = ptr[i].sz;
}
tmpInserPtr += no_segs;
- for(Uint32 i = 0; i<no_segs; i++){
+ for(i = 0; i<no_segs; i++){
import(tmpInserPtr, ptr[i]);
}
@@ -450,6 +451,7 @@ Packer::pack(Uint32 * insertPtr,
const Uint32 * theData,
class SectionSegmentPool & thePool,
const SegmentedSectionPtr ptr[3]) const {
+ Uint32 i;
Uint32 dataLen32 = header->theLength;
Uint32 no_segs = header->m_noOfSections;
@@ -458,7 +460,7 @@ Packer::pack(Uint32 * insertPtr,
dataLen32 + no_segs +
checksumUsed + signalIdUsed + (sizeof(Protocol6)/4);
- for(Uint32 i = 0; i<no_segs; i++){
+ for(i = 0; i<no_segs; i++){
len32 += ptr[i].sz;
}
@@ -487,12 +489,12 @@ Packer::pack(Uint32 * insertPtr,
memcpy(tmpInserPtr, theData, 4 * dataLen32);
tmpInserPtr += dataLen32;
- for(Uint32 i = 0; i<no_segs; i++){
+ for(i = 0; i<no_segs; i++){
tmpInserPtr[i] = ptr[i].sz;
}
tmpInserPtr += no_segs;
- for(Uint32 i = 0; i<no_segs; i++){
+ for(i = 0; i<no_segs; i++){
copy(tmpInserPtr, thePool, ptr[i]);
}
diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp
index 3d42c40f720..aa1913e3040 100644
--- a/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -882,7 +882,7 @@ TransporterRegistry::performReceive(){
static int x = 0;
void
TransporterRegistry::performSend(){
-
+ int i;
sendCounter = 1;
#ifdef NDB_OSE_TRANSPORTER
@@ -906,7 +906,7 @@ TransporterRegistry::performSend(){
FD_ZERO(&writeset);
// Prepare for sending and receiving
- for (int i = 0; i < nTCPTransporters; i++) {
+ for (i = 0; i < nTCPTransporters; i++) {
TCP_Transporter * t = theTCPTransporters[i];
// If the transporter is connected
@@ -931,7 +931,7 @@ TransporterRegistry::performSend(){
if (tmp == 0) {
return;
}//if
- for (int i = 0; i < nTCPTransporters; i++) {
+ for (i = 0; i < nTCPTransporters; i++) {
TCP_Transporter *t = theTCPTransporters[i];
const NodeId nodeId = t->getRemoteNodeId();
const int socket = t->getSocket();
@@ -944,7 +944,7 @@ TransporterRegistry::performSend(){
}
#endif
#ifdef NDB_TCP_TRANSPORTER
- for (int i = x; i < nTCPTransporters; i++) {
+ for (i = x; i < nTCPTransporters; i++) {
TCP_Transporter *t = theTCPTransporters[i];
if (t &&
(t->hasDataToSend()) &&
@@ -953,7 +953,7 @@ TransporterRegistry::performSend(){
t->doSend();
}//if
}//for
- for (int i = 0; i < x && i < nTCPTransporters; i++) {
+ for (i = 0; i < x && i < nTCPTransporters; i++) {
TCP_Transporter *t = theTCPTransporters[i];
if (t &&
(t->hasDataToSend()) &&
@@ -969,7 +969,7 @@ TransporterRegistry::performSend(){
#ifdef NDB_SCI_TRANSPORTER
//scroll through the SCI transporters,
// get each transporter, check if connected, send data
- for (int i=0; i<nSCITransporters; i++) {
+ for (i=0; i<nSCITransporters; i++) {
SCI_Transporter *t = theSCITransporters[i];
const NodeId nodeId = t->getRemoteNodeId();
diff --git a/ndb/src/common/util/BaseString.cpp b/ndb/src/common/util/BaseString.cpp
index d15249adf72..8b7df485f77 100644
--- a/ndb/src/common/util/BaseString.cpp
+++ b/ndb/src/common/util/BaseString.cpp
@@ -412,3 +412,6 @@ int main()
}
#endif
+
+template class Vector<char *>;
+template class Vector<BaseString>;
diff --git a/ndb/src/common/util/ConfigValues.cpp b/ndb/src/common/util/ConfigValues.cpp
index 1dcb542e92c..8a14882550c 100644
--- a/ndb/src/common/util/ConfigValues.cpp
+++ b/ndb/src/common/util/ConfigValues.cpp
@@ -105,19 +105,19 @@ ConfigValues::getByPos(Uint32 pos, Entry * result) const {
Uint64 *
ConfigValues::get64(Uint32 index) const {
assert(index < m_int64Count);
- const Uint32 * data = m_values + (m_size << 1);
+ const Uint32 * data = m_values + (m_size << 1);
Uint64 * ptr = (Uint64*)data;
- ptr += index;
+ ptr += index;
return ptr;
}
char **
ConfigValues::getString(Uint32 index) const {
assert(index < m_stringCount);
- const Uint32 * data = m_values + (m_size << 1);
- char * ptr = (char*)data;
+ const Uint32 * data = m_values + (m_size << 1);
+ char * ptr = (char*)data;
ptr += m_dataSize;
- ptr -= (index * sizeof(char *));
+ ptr -= (index * sizeof(char *));
return (char**)ptr;
}
@@ -464,7 +464,7 @@ ConfigValuesFactory::put(const ConfigValues::Entry & entry){
case ConfigValues::StringType:{
Uint32 index = m_cfg->m_stringCount++;
m_cfg->m_values[pos+1] = index;
- char ** ref = m_cfg->getString(index);
+ char ** ref = m_cfg->getString(index);
* ref = strdup(entry.m_string ? entry.m_string : "");
m_freeKeys--;
m_freeData -= sizeof(char *);
@@ -580,11 +580,11 @@ ConfigValues::getPackedSize() const {
Uint32
ConfigValues::pack(void * _dst, Uint32 _len) const {
-
+ Uint32 i;
char * dst = (char*)_dst;
memcpy(dst, Magic, sizeof(Magic)); dst += sizeof(Magic);
- for(Uint32 i = 0; i < 2 * m_size; i += 2){
+ for(i = 0; i < 2 * m_size; i += 2){
Uint32 key = m_values[i];
Uint32 val = m_values[i+1];
if(key != CFV_KEY_FREE){
@@ -623,7 +623,7 @@ ConfigValues::pack(void * _dst, Uint32 _len) const {
const Uint32 * sum = (Uint32*)_dst;
const Uint32 len = ((Uint32*)dst) - sum;
Uint32 chk = 0;
- for(Uint32 i = 0; i<len; i++){
+ for(i = 0; i<len; i++){
chk ^= htonl(sum[i]);
}
diff --git a/ndb/src/common/util/Parser.cpp b/ndb/src/common/util/Parser.cpp
index 2e8120f88ce..dea128ccf66 100644
--- a/ndb/src/common/util/Parser.cpp
+++ b/ndb/src/common/util/Parser.cpp
@@ -347,3 +347,4 @@ ParserImpl::checkMandatory(Context* ctx, const Properties* props){
return true;
}
+template class Vector<const ParserRow<ParserImpl::Dummy>*>;
diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp
index 3e41056ac18..8db7b075d1b 100644
--- a/ndb/src/common/util/Properties.cpp
+++ b/ndb/src/common/util/Properties.cpp
@@ -169,6 +169,7 @@ put(PropertiesImpl * impl, const char * name, T value, bool replace){
return tmp->put(new PropertyImpl(short_name, value));
}
+
bool
Properties::put(const char * name, Uint32 value, bool replace){
return ::put(impl, name, value, replace);
@@ -1120,3 +1121,8 @@ bool
Properties::getCaseInsensitiveNames() const {
return impl->m_insensitive;
}
+
+template bool put(PropertiesImpl *, const char *, Uint32, bool);
+template bool put(PropertiesImpl *, const char *, Uint64, bool);
+template bool put(PropertiesImpl *, const char *, const char *, bool);
+template bool put(PropertiesImpl *, const char *, const Properties*, bool);
diff --git a/ndb/src/common/util/SocketServer.cpp b/ndb/src/common/util/SocketServer.cpp
index 67cbf8aba4a..44c57c766f8 100644
--- a/ndb/src/common/util/SocketServer.cpp
+++ b/ndb/src/common/util/SocketServer.cpp
@@ -36,10 +36,11 @@ SocketServer::SocketServer(int maxSessions) :
}
SocketServer::~SocketServer() {
- for(unsigned i = 0; i<m_sessions.size(); i++){
+ unsigned i;
+ for(i = 0; i<m_sessions.size(); i++){
delete m_sessions[i].m_session;
}
- for(unsigned i = 0; i<m_services.size(); i++){
+ for(i = 0; i<m_services.size(); i++){
delete m_services[i].m_service;
}
}
@@ -265,10 +266,11 @@ SocketServer::checkSessions(){
void
SocketServer::stopSessions(bool wait){
- for(int i = m_sessions.size() - 1; i>=0; i--)
+ int i;
+ for(i = m_sessions.size() - 1; i>=0; i--)
m_sessions[i].m_session->m_stop = true;
- for(int i = m_services.size() - 1; i>=0; i--)
+ for(i = m_services.size() - 1; i>=0; i--)
m_services[i].m_service->stopSessions();
if(wait){
@@ -303,3 +305,6 @@ sessionThread_C(void* _sc){
NdbThread_Exit(0);
return 0;
}
+
+template class MutexVector<SocketServer::ServiceInstance>;
+template class MutexVector<SocketServer::SessionInstance>;
diff --git a/ndb/src/cw/cpcd/CPCD.cpp b/ndb/src/cw/cpcd/CPCD.cpp
index f2878b7dea1..40a5fd49493 100644
--- a/ndb/src/cw/cpcd/CPCD.cpp
+++ b/ndb/src/cw/cpcd/CPCD.cpp
@@ -351,8 +351,9 @@ CPCD::loadProcessList(){
sess.loadFile();
loadingProcessList = false;
+ size_t i;
Vector<int> temporary;
- for(size_t i = 0; i<m_processes.size(); i++){
+ for(i = 0; i<m_processes.size(); i++){
Process * proc = m_processes[i];
proc->readPid();
if(proc->m_processType == TEMPORARY){
@@ -360,7 +361,7 @@ CPCD::loadProcessList(){
}
}
- for(size_t i = 0; i<temporary.size(); i++){
+ for(i = 0; i<temporary.size(); i++){
RequestStatus rs;
undefineProcess(&rs, temporary[i]);
}
diff --git a/ndb/src/cw/cpcd/Process.cpp b/ndb/src/cw/cpcd/Process.cpp
index d99dda2ba0b..a67dba95dc7 100644
--- a/ndb/src/cw/cpcd/Process.cpp
+++ b/ndb/src/cw/cpcd/Process.cpp
@@ -252,7 +252,7 @@ set_ulimit(const BaseString & pair){
void
CPCD::Process::do_exec() {
-
+ size_t i;
setup_environment(m_env.c_str());
char **argv = BaseString::argify(m_path.c_str(), m_args.c_str());
@@ -268,7 +268,7 @@ CPCD::Process::do_exec() {
Vector<BaseString> ulimit;
m_ulimit.split(ulimit);
- for(size_t i = 0; i<ulimit.size(); i++){
+ for(i = 0; i<ulimit.size(); i++){
if(ulimit[i].trim().length() > 0 && set_ulimit(ulimit[i]) != 0){
_exit(1);
}
@@ -282,7 +282,7 @@ CPCD::Process::do_exec() {
BaseString * redirects[] = { &m_stdin, &m_stdout, &m_stderr };
int fds[3];
- for(int i = 0; i<3; i++){
+ for(i = 0; i<3; i++){
if(redirects[i]->empty()){
#ifndef DEBUG
dup2(fd, i);
@@ -315,7 +315,7 @@ CPCD::Process::do_exec() {
}
/* Close all filedescriptors */
- for(int i = STDERR_FILENO+1; i < getdtablesize(); i++)
+ for(i = STDERR_FILENO+1; i < getdtablesize(); i++)
close(i);
execv(m_path.c_str(), argv);
diff --git a/ndb/src/kernel/blocks/backup/Backup.cpp b/ndb/src/kernel/blocks/backup/Backup.cpp
index 4342a9d6d94..52a543dbcdc 100644
--- a/ndb/src/kernel/blocks/backup/Backup.cpp
+++ b/ndb/src/kernel/blocks/backup/Backup.cpp
@@ -3332,7 +3332,8 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal)
req->transId1 = 0;
req->transId2 = (BACKUP << 20) + (getOwnNodeId() << 8);
- for(unsigned int i = 0; i<parallelism; i++) {
+ Uint32 i;
+ for(i = 0; i<parallelism; i++) {
jam();
req->clientOpPtr[i] = filePtr.i;
}//for
@@ -3350,7 +3351,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal)
signal->theData[7] = 0;
Uint32 dataPos = 8;
- for(Uint32 i = 0; i<table.noOfAttributes; i++) {
+ for(i = 0; i<table.noOfAttributes; i++) {
jam();
AttributePtr attr;
table.attributes.getPtr(attr, i);
diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp
index 36ce1857144..d8cbb36df62 100644
--- a/ndb/src/kernel/blocks/backup/BackupInit.cpp
+++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp
@@ -213,3 +213,6 @@ Backup::~Backup()
BLOCK_FUNCTIONS(Backup);
+template class ArrayPool<Backup::Page32>;
+template class ArrayPool<Backup::Attribute>;
+template class ArrayPool<Backup::Fragment>;
diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.cpp b/ndb/src/kernel/blocks/backup/restore/Restore.cpp
index 24d2cfbfe35..8adef788365 100644
--- a/ndb/src/kernel/blocks/backup/restore/Restore.cpp
+++ b/ndb/src/kernel/blocks/backup/restore/Restore.cpp
@@ -34,6 +34,7 @@ Uint64 Twiddle64(Uint64 in); // Byte shift 64-bit data
bool
BackupFile::Twiddle(const AttributeDesc* attr_desc, AttributeData* attr_data, Uint32 arraySize){
+ Uint32 i;
if(m_hostByteOrder)
return true;
@@ -47,17 +48,17 @@ BackupFile::Twiddle(const AttributeDesc* attr_desc, AttributeData* attr_data, Ui
return true;
case 16:
- for(unsigned i = 0; i<arraySize; i++){
+ for(i = 0; i<arraySize; i++){
attr_data->u_int16_value[i] = Twiddle16(attr_data->u_int16_value[i]);
}
return true;
case 32:
- for(unsigned i = 0; i<arraySize; i++){
+ for(i = 0; i<arraySize; i++){
attr_data->u_int32_value[i] = Twiddle32(attr_data->u_int32_value[i]);
}
return true;
case 64:
- for(unsigned i = 0; i<arraySize; i++){
+ for(i = 0; i<arraySize; i++){
attr_data->u_int64_value[i] = Twiddle64(attr_data->u_int64_value[i]);
}
return true;
@@ -333,8 +334,8 @@ RestoreDataIterator::getNextTuple(int & res)
Uint32 *buf_ptr = (Uint32*)_buf_ptr, *ptr = buf_ptr;
ptr += m_currentTable->m_nullBitmaskSize;
-
- for(Uint32 i= 0; i < m_currentTable->m_fixedKeys.size(); i++){
+ Uint32 i;
+ for(i= 0; i < m_currentTable->m_fixedKeys.size(); i++){
assert(ptr < buf_ptr + dataLength);
const Uint32 attrId = m_currentTable->m_fixedKeys[i]->attrId;
@@ -355,7 +356,7 @@ RestoreDataIterator::getNextTuple(int & res)
ptr += sz;
}
- for(Uint32 i = 0; i < m_currentTable->m_fixedAttribs.size(); i++){
+ for(i = 0; i < m_currentTable->m_fixedAttribs.size(); i++){
assert(ptr < buf_ptr + dataLength);
const Uint32 attrId = m_currentTable->m_fixedAttribs[i]->attrId;
@@ -377,7 +378,7 @@ RestoreDataIterator::getNextTuple(int & res)
ptr += sz;
}
- for(Uint32 i = 0; i < m_currentTable->m_variableAttribs.size(); i++){
+ for(i = 0; i < m_currentTable->m_variableAttribs.size(); i++){
const Uint32 attrId = m_currentTable->m_variableAttribs[i]->attrId;
AttributeData * attr_data = m_tuple.getData(attrId);
diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.hpp b/ndb/src/kernel/blocks/backup/restore/Restore.hpp
index e9149e38e44..5a705740c69 100644
--- a/ndb/src/kernel/blocks/backup/restore/Restore.hpp
+++ b/ndb/src/kernel/blocks/backup/restore/Restore.hpp
@@ -301,9 +301,10 @@ public:
}
~LogEntry()
{
- for(Uint32 i= 0; i< m_values.size(); i++)
+ Uint32 i;
+ for(i= 0; i< m_values.size(); i++)
delete m_values[i];
- for(Uint32 i= 0; i< m_values_e.size(); i++)
+ for(i= 0; i< m_values_e.size(); i++)
delete m_values_e[i];
}
Uint32 size() const { return m_values.size(); }
diff --git a/ndb/src/kernel/blocks/backup/restore/main.cpp b/ndb/src/kernel/blocks/backup/restore/main.cpp
index 99deeb3115c..be58d72ff72 100644
--- a/ndb/src/kernel/blocks/backup/restore/main.cpp
+++ b/ndb/src/kernel/blocks/backup/restore/main.cpp
@@ -250,8 +250,8 @@ main(int argc, const char** argv)
return -1;
}
-
- for(Uint32 i= 0; i < g_consumers.size(); i++)
+ Uint32 i;
+ for(i= 0; i < g_consumers.size(); i++)
{
if (!g_consumers[i]->init())
{
@@ -261,7 +261,7 @@ main(int argc, const char** argv)
}
- for(Uint32 i = 0; i<metaData.getNoOfTables(); i++)
+ for(i = 0; i<metaData.getNoOfTables(); i++)
{
if (checkSysTable(metaData[i]->getTableName()))
{
@@ -345,7 +345,7 @@ main(int argc, const char** argv)
return -1;
}
logIter.validateFooter(); //not implemented
- for (Uint32 i= 0; i < g_consumers.size(); i++)
+ for (i= 0; i < g_consumers.size(); i++)
g_consumers[i]->endOfLogEntrys();
}
}
diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
index 176b9590c60..ef0f91841dc 100644
--- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
@@ -1071,14 +1071,15 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
}
if (dumpState->args[0] == DumpStateOrd::CmvmiTestLongSigWithDelay) {
+ unsigned i;
Uint32 loopCount = dumpState->args[1];
const unsigned len0 = 11;
const unsigned len1 = 123;
Uint32 sec0[len0];
Uint32 sec1[len1];
- for (unsigned i = 0; i < len0; i++)
+ for (i = 0; i < len0; i++)
sec0[i] = i;
- for (unsigned i = 0; i < len1; i++)
+ for (i = 0; i < len1; i++)
sec1[i] = 16 * i;
Uint32* sig = signal->getDataPtrSend();
sig[0] = reference();
@@ -1131,6 +1132,7 @@ static LinearSectionPtr g_test[3];
void
Cmvmi::execTESTSIG(Signal* signal){
+ Uint32 i;
/**
* Test of SafeCounter
*/
@@ -1155,14 +1157,14 @@ Cmvmi::execTESTSIG(Signal* signal){
getOwnNodeId(),
true);
ndbout_c("-- Fixed section --");
- for(Uint32 i = 0; i<signal->length(); i++){
+ for(i = 0; i<signal->length(); i++){
fprintf(stdout, "H'0x%.8x ", signal->theData[i]);
if(((i + 1) % 6) == 0)
fprintf(stdout, "\n");
}
fprintf(stdout, "\n");
- for(Uint32 i = 0; i<signal->header.m_noOfSections; i++){
+ for(i = 0; i<signal->header.m_noOfSections; i++){
SegmentedSectionPtr ptr;
ndbout_c("-- Section %d --", i);
signal->getSection(ptr, i);
@@ -1175,7 +1177,7 @@ Cmvmi::execTESTSIG(Signal* signal){
/**
* Validate length:s
*/
- for(Uint32 i = 0; i<signal->header.m_noOfSections; i++){
+ for(i = 0; i<signal->header.m_noOfSections; i++){
SegmentedSectionPtr ptr;
signal->getSection(ptr, i);
ndbrequire(ptr.p != 0);
@@ -1220,7 +1222,7 @@ Cmvmi::execTESTSIG(Signal* signal){
case 4:{
LinearSectionPtr ptr[3];
const Uint32 secs = signal->getNoOfSections();
- for(Uint32 i = 0; i<secs; i++){
+ for(i = 0; i<secs; i++){
SegmentedSectionPtr sptr;
signal->getSection(sptr, i);
ptr[i].sz = sptr.sz;
@@ -1269,7 +1271,7 @@ Cmvmi::execTESTSIG(Signal* signal){
case 8:{
LinearSectionPtr ptr[3];
const Uint32 secs = signal->getNoOfSections();
- for(Uint32 i = 0; i<secs; i++){
+ for(i = 0; i<secs; i++){
SegmentedSectionPtr sptr;
signal->getSection(sptr, i);
ptr[i].sz = sptr.sz;
@@ -1303,7 +1305,7 @@ Cmvmi::execTESTSIG(Signal* signal){
sendNextLinearFragment(signal, fragSend);
}
- for(Uint32 i = 0; i<secs; i++){
+ for(i = 0; i<secs; i++){
delete[] ptr[i].p;
}
break;
@@ -1335,7 +1337,7 @@ Cmvmi::execTESTSIG(Signal* signal){
const Uint32 secs = signal->getNoOfSections();
memset(g_test, 0, sizeof(g_test));
- for(Uint32 i = 0; i<secs; i++){
+ for(i = 0; i<secs; i++){
SegmentedSectionPtr sptr;
signal->getSection(sptr, i);
g_test[i].sz = sptr.sz;
@@ -1379,7 +1381,7 @@ Cmvmi::execTESTSIG(Signal* signal){
case 14:{
Uint32 count = signal->theData[8];
signal->theData[10] = count * rg.m_nodes.count();
- for(Uint32 i = 0; i<count; i++){
+ for(i = 0; i<count; i++){
sendSignal(rg, GSN_TESTSIG, signal, signal->length(), JBB);
}
return;
diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
index ccc1acdd273..10fd703e387 100644
--- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
+++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
@@ -9245,8 +9245,8 @@ void Dbacc::initFragGeneral(FragmentrecPtr regFragPtr)
for (Uint32 i = 0; i < ZWRITEPAGESIZE; i++) {
regFragPtr.p->datapages[i] = RNIL;
}//for
- for (Uint32 i = 0; i < 4; i++) {
- regFragPtr.p->longKeyPageArray[i] = RNIL;
+ for (Uint32 j = 0; j < 4; j++) {
+ regFragPtr.p->longKeyPageArray[j] = RNIL;
}//for
}//Dbacc::initFragGeneral()
diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
index 3b99f0d5392..70d27934f1e 100644
--- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
@@ -5769,6 +5769,7 @@ void
Dbdict::execLIST_TABLES_REQ(Signal* signal)
{
jamEntry();
+ Uint32 i;
ListTablesReq * req = (ListTablesReq*)signal->getDataPtr();
Uint32 senderRef = req->senderRef;
Uint32 senderData = req->senderData;
@@ -5782,7 +5783,7 @@ Dbdict::execLIST_TABLES_REQ(Signal* signal)
conf->senderData = senderData;
conf->counter = 0;
Uint32 pos = 0;
- for (Uint32 i = 0; i < c_tableRecordPool.getSize(); i++) {
+ for (i = 0; i < c_tableRecordPool.getSize(); i++) {
TableRecordPtr tablePtr;
c_tableRecordPool.getPtr(tablePtr, i);
// filter
@@ -5862,12 +5863,12 @@ Dbdict::execLIST_TABLES_REQ(Signal* signal)
conf->counter++;
pos = 0;
}
- Uint32 i = 0;
- while (i < size) {
+ Uint32 k = 0;
+ while (k < size) {
char* p = (char*)&conf->tableData[pos];
for (Uint32 j = 0; j < 4; j++) {
- if (i < size)
- *p++ = tablePtr.p->tableName[i++];
+ if (k < size)
+ *p++ = tablePtr.p->tableName[k++];
else
*p++ = 0;
}
@@ -5881,7 +5882,7 @@ Dbdict::execLIST_TABLES_REQ(Signal* signal)
}
}
// XXX merge with above somehow
- for (Uint32 i = 0; i < c_triggerRecordPool.getSize(); i++) {
+ for (i = 0; i < c_triggerRecordPool.getSize(); i++) {
if (reqListIndexes)
break;
TriggerRecordPtr triggerPtr;
@@ -5925,12 +5926,12 @@ Dbdict::execLIST_TABLES_REQ(Signal* signal)
conf->counter++;
pos = 0;
}
- Uint32 i = 0;
- while (i < size) {
+ Uint32 k = 0;
+ while (k < size) {
char* p = (char*)&conf->tableData[pos];
for (Uint32 j = 0; j < 4; j++) {
- if (i < size)
- *p++ = triggerPtr.p->triggerName[i++];
+ if (k < size)
+ *p++ = triggerPtr.p->triggerName[k++];
else
*p++ = 0;
}
@@ -6167,6 +6168,7 @@ Dbdict::createIndex_slavePrepare(Signal* signal, OpCreateIndexPtr opPtr)
void
Dbdict::createIndex_toCreateTable(Signal* signal, OpCreateIndexPtr opPtr)
{
+ Uint32 k;
jam();
const CreateIndxReq* const req = &opPtr.p->m_request;
// signal data writer
@@ -6236,7 +6238,7 @@ Dbdict::createIndex_toCreateTable(Signal* signal, OpCreateIndexPtr opPtr)
}
// hash index attributes must currently be in table order
Uint32 prevAttrId = RNIL;
- for (Uint32 k = 0; k < opPtr.p->m_attrList.sz; k++) {
+ for (k = 0; k < opPtr.p->m_attrList.sz; k++) {
jam();
bool found = false;
for (Uint32 tAttr = tablePtr.p->firstAttribute; tAttr != RNIL; ) {
@@ -6296,7 +6298,7 @@ Dbdict::createIndex_toCreateTable(Signal* signal, OpCreateIndexPtr opPtr)
// write index key attributes
AttributeRecordPtr aRecPtr;
c_attributeRecordPool.getPtr(aRecPtr, tablePtr.p->firstAttribute);
- for (Uint32 k = 0; k < opPtr.p->m_attrList.sz; k++) {
+ for (k = 0; k < opPtr.p->m_attrList.sz; k++) {
jam();
for (Uint32 tAttr = tablePtr.p->firstAttribute; tAttr != RNIL; ) {
AttributeRecord* aRec = c_attributeRecordPool.getPtr(tAttr);
diff --git a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
index f996a1fe689..7ca45ef4b43 100644
--- a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
+++ b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
@@ -50,17 +50,18 @@ void Dbdih::initData()
nodeRecord = (NodeRecord*)
allocRecord("NodeRecord", sizeof(NodeRecord), MAX_NDB_NODES);
- for(Uint32 i = 0; i<MAX_NDB_NODES; i++){
+ Uint32 i;
+ for(i = 0; i<MAX_NDB_NODES; i++){
new (&nodeRecord[i]) NodeRecord();
}
takeOverRecord = (TakeOverRecord*)allocRecord("TakeOverRecord",
sizeof(TakeOverRecord),
MAX_NDB_NODES);
- for(Uint32 i = 0; i<MAX_NDB_NODES; i++)
+ for(i = 0; i<MAX_NDB_NODES; i++)
new (&takeOverRecord[i]) TakeOverRecord();
- for(Uint32 i = 0; i<MAX_NDB_NODES; i++)
+ for(i = 0; i<MAX_NDB_NODES; i++)
new (&takeOverRecord[i]) TakeOverRecord();
waitGCPProxyPool.setSize(ZPROXY_FILE_SIZE);
diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
index 059f1301ba2..557fed03498 100644
--- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
@@ -1534,11 +1534,12 @@ void Dbdih::execSTART_MECONF(Signal* signal)
StartMeConf * const startMe = (StartMeConf *)&signal->theData[0];
Uint32 nodeId = startMe->startingNodeId;
const Uint32 startWord = startMe->startWord;
+ Uint32 i;
CRASH_INSERTION(7130);
ndbrequire(nodeId == cownNodeId);
arrGuard(startWord + StartMeConf::DATA_SIZE, sizeof(cdata)/4);
- for(Uint32 i = 0; i < StartMeConf::DATA_SIZE; i++)
+ for(i = 0; i < StartMeConf::DATA_SIZE; i++)
cdata[startWord+i] = startMe->data[i];
if(startWord + StartMeConf::DATA_SIZE < Sysfile::SYSFILE_SIZE32){
@@ -1556,12 +1557,12 @@ void Dbdih::execSTART_MECONF(Signal* signal)
* But dont copy lastCompletedGCI:s
*/
Uint32 tempGCP[MAX_NDB_NODES];
- for(Uint32 i = 0; i < MAX_NDB_NODES; i++)
+ for(i = 0; i < MAX_NDB_NODES; i++)
tempGCP[i] = SYSFILE->lastCompletedGCI[i];
- for(Uint32 i = 0; i < Sysfile::SYSFILE_SIZE32; i++)
+ for(i = 0; i < Sysfile::SYSFILE_SIZE32; i++)
sysfileData[i] = cdata[i];
- for(Uint32 i = 0; i < MAX_NDB_NODES; i++)
+ for(i = 0; i < MAX_NDB_NODES; i++)
SYSFILE->lastCompletedGCI[i] = tempGCP[i];
setNodeActiveStatus();
@@ -3599,6 +3600,7 @@ void Dbdih::writeInitGcpLab(Signal* signal, FileRecordPtr filePtr)
/*---------------------------------------------------------------------------*/
void Dbdih::execNODE_FAILREP(Signal* signal)
{
+ Uint32 i;
Uint32 failedNodes[MAX_NDB_NODES];
jamEntry();
NodeFailRep * const nodeFail = (NodeFailRep *)&signal->theData[0];
@@ -3611,7 +3613,7 @@ void Dbdih::execNODE_FAILREP(Signal* signal)
// The first step is to convert from a bit mask to an array of failed nodes.
/*-------------------------------------------------------------------------*/
Uint32 index = 0;
- for (Uint32 i = 1; i < MAX_NDB_NODES; i++) {
+ for (i = 1; i < MAX_NDB_NODES; i++) {
jam();
if(NodeBitmask::get(nodeFail->theNodes, i)){
jam();
@@ -3629,7 +3631,7 @@ void Dbdih::execNODE_FAILREP(Signal* signal)
// We also set certain state variables ensuring that the node no longer is
// used in transactions and also mark that we received this signal.
/*-------------------------------------------------------------------------*/
- for (Uint32 i = 0; i < noOfFailedNodes; i++) {
+ for (i = 0; i < noOfFailedNodes; i++) {
jam();
NodeRecordPtr TNodePtr;
TNodePtr.i = failedNodes[i];
@@ -3671,7 +3673,7 @@ void Dbdih::execNODE_FAILREP(Signal* signal)
const bool masterTakeOver = (oldMasterId != newMasterId);
- for(Uint32 i = 0; i < noOfFailedNodes; i++) {
+ for(i = 0; i < noOfFailedNodes; i++) {
NodeRecordPtr failedNodePtr;
failedNodePtr.i = failedNodes[i];
ptrCheckGuard(failedNodePtr, MAX_NDB_NODES, nodeRecord);
@@ -6882,8 +6884,9 @@ void Dbdih::releaseFragments(TabRecordPtr tabPtr)
void Dbdih::initialiseFragstore()
{
+ Uint32 i;
FragmentstorePtr fragPtr;
- for (Uint32 i = 0; i < cfragstoreFileSize; i++) {
+ for (i = 0; i < cfragstoreFileSize; i++) {
fragPtr.i = i;
ptrCheckGuard(fragPtr, cfragstoreFileSize, fragmentstore);
initFragstore(fragPtr);
@@ -6892,7 +6895,7 @@ void Dbdih::initialiseFragstore()
fragPtr.i = 0;
cfirstfragstore = RNIL;
cremainingfrags = 0;
- for (Uint32 i = 0; i < noOfChunks; i++) {
+ for (i = 0; i < noOfChunks; i++) {
ptrCheckGuard(fragPtr, cfragstoreFileSize, fragmentstore);
fragPtr.p->nextFragmentChunk = cfirstfragstore;
cfirstfragstore = fragPtr.i;
@@ -10231,11 +10234,12 @@ void Dbdih::allocStoredReplica(FragmentstorePtr fragPtr,
ReplicaRecordPtr& newReplicaPtr,
Uint32 nodeId)
{
+ Uint32 i;
ReplicaRecordPtr arrReplicaPtr;
ReplicaRecordPtr arrPrevReplicaPtr;
seizeReplicaRec(newReplicaPtr);
- for (Uint32 i = 0; i < MAX_LCP_STORED; i++) {
+ for (i = 0; i < MAX_LCP_STORED; i++) {
newReplicaPtr.p->maxGciCompleted[i] = 0;
newReplicaPtr.p->maxGciStarted[i] = 0;
newReplicaPtr.p->lcpId[i] = 0;
@@ -10243,7 +10247,7 @@ void Dbdih::allocStoredReplica(FragmentstorePtr fragPtr,
}//for
newReplicaPtr.p->noCrashedReplicas = 0;
newReplicaPtr.p->initialGci = currentgcp;
- for (Uint32 i = 0; i < 8; i++) {
+ for (i = 0; i < 8; i++) {
newReplicaPtr.p->replicaLastGci[i] = (Uint32)-1;
newReplicaPtr.p->createGci[i] = 0;
}//for
@@ -10354,7 +10358,8 @@ void Dbdih::checkEscalation()
{
Uint32 TnodeGroup[MAX_NDB_NODES];
NodeRecordPtr nodePtr;
- for (Uint32 i = 0; i < MAX_NDB_NODES; i++) {
+ Uint32 i;
+ for (i = 0; i < MAX_NDB_NODES; i++) {
TnodeGroup[i] = ZFALSE;
}//for
for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
@@ -10366,7 +10371,7 @@ void Dbdih::checkEscalation()
TnodeGroup[nodePtr.p->nodeGroup] = ZTRUE;
}
}
- for (Uint32 i = 0; i < cnoOfNodeGroups; i++) {
+ for (i = 0; i < cnoOfNodeGroups; i++) {
jam();
if (TnodeGroup[i] == ZFALSE) {
jam();
@@ -10929,7 +10934,8 @@ void Dbdih::initNodeState(NodeRecordPtr nodePtr)
/*************************************************************************/
void Dbdih::initRestartInfo()
{
- for (int i = 0; i < MAX_NDB_NODES; i++) {
+ Uint32 i;
+ for (i = 0; i < MAX_NDB_NODES; i++) {
SYSFILE->lastCompletedGCI[i] = 0;
}//for
NodeRecordPtr nodePtr;
@@ -10950,10 +10956,10 @@ void Dbdih::initRestartInfo()
SYSFILE->oldestRestorableGCI = 1;
SYSFILE->newestRestorableGCI = 1;
SYSFILE->systemRestartBits = 0;
- for (Uint32 i = 0; i < NodeBitmask::Size; i++) {
+ for (i = 0; i < NodeBitmask::Size; i++) {
SYSFILE->lcpActive[0] = 0;
}//for
- for (Uint32 i = 0; i < Sysfile::TAKE_OVER_SIZE; i++) {
+ for (i = 0; i < Sysfile::TAKE_OVER_SIZE; i++) {
SYSFILE->takeOver[i] = 0;
}//for
Sysfile::setInitialStartOngoing(SYSFILE->systemRestartBits);
@@ -11032,10 +11038,11 @@ void Dbdih::initTable(TabRecordPtr tabPtr)
tabPtr.p->tabFile[1] = RNIL;
tabPtr.p->m_dropTab.tabUserRef = 0;
tabPtr.p->m_dropTab.tabUserPtr = RNIL;
- for (Uint32 i = 0; i < MAX_NDB_NODES; i++) {
+ Uint32 i;
+ for (i = 0; i < MAX_NDB_NODES; i++) {
tabPtr.p->startFid[i] = RNIL;
}//for
- for (Uint32 i = 0; i < 8; i++) {
+ for (i = 0; i < 8; i++) {
tabPtr.p->pageRef[i] = RNIL;
}//for
tabPtr.p->tableType = DictTabInfo::UndefTableType;
@@ -11367,6 +11374,7 @@ void Dbdih::makeNodeGroups(Uint32 nodeArray[])
Uint32 tmngNodeGroup;
Uint32 tmngReplica;
Uint32 tmngLimit;
+ Uint32 i;
/**-----------------------------------------------------------------------
* ASSIGN ALL ACTIVE NODES INTO NODE GROUPS. HOT SPARE NODES ARE ASSIGNED
@@ -11376,7 +11384,7 @@ void Dbdih::makeNodeGroups(Uint32 nodeArray[])
tmngReplica = 0;
tmngLimit = csystemnodes - cnoHotSpare;
ndbrequire(tmngLimit < MAX_NDB_NODES);
- for (Uint32 i = 0; i < tmngLimit; i++) {
+ for (i = 0; i < tmngLimit; i++) {
NodeGroupRecordPtr NGPtr;
jam();
tmngNode = nodeArray[i];
@@ -11396,14 +11404,14 @@ void Dbdih::makeNodeGroups(Uint32 nodeArray[])
}//for
cnoOfNodeGroups = tmngNodeGroup;
ndbrequire(csystemnodes < MAX_NDB_NODES);
- for (Uint32 i = tmngLimit + 1; i < csystemnodes; i++) {
+ for (i = tmngLimit + 1; i < csystemnodes; i++) {
jam();
tmngNode = nodeArray[i];
mngNodeptr.i = tmngNode;
ptrCheckGuard(mngNodeptr, MAX_NDB_NODES, nodeRecord);
mngNodeptr.p->nodeGroup = ZNIL;
}//for
- for(int i = 0; i < MAX_NDB_NODES; i++){
+ for(i = 0; i < MAX_NDB_NODES; i++){
jam();
Sysfile::setNodeGroup(i, SYSFILE->nodeGroups, NO_NODE_GROUP_ID);
}//for
@@ -11690,12 +11698,13 @@ Uint32 Dbdih::readPageWord(RWFragment* rf)
void Dbdih::readReplica(RWFragment* rf, ReplicaRecordPtr readReplicaPtr)
{
+ Uint32 i;
readReplicaPtr.p->procNode = readPageWord(rf);
readReplicaPtr.p->initialGci = readPageWord(rf);
readReplicaPtr.p->noCrashedReplicas = readPageWord(rf);
readReplicaPtr.p->nextLcp = readPageWord(rf);
- for (Uint32 i = 0; i < MAX_LCP_STORED; i++) {
+ for (i = 0; i < MAX_LCP_STORED; i++) {
readReplicaPtr.p->maxGciCompleted[i] = readPageWord(rf);
readReplicaPtr.p->maxGciStarted[i] = readPageWord(rf);
readReplicaPtr.p->lcpId[i] = readPageWord(rf);
@@ -11703,13 +11712,13 @@ void Dbdih::readReplica(RWFragment* rf, ReplicaRecordPtr readReplicaPtr)
}//for
const Uint32 noCrashedReplicas = readReplicaPtr.p->noCrashedReplicas;
ndbrequire(noCrashedReplicas < 8);
- for (Uint32 i = 0; i < noCrashedReplicas; i++) {
+ for (i = 0; i < noCrashedReplicas; i++) {
readReplicaPtr.p->createGci[i] = readPageWord(rf);
readReplicaPtr.p->replicaLastGci[i] = readPageWord(rf);
ndbrequire(readReplicaPtr.p->createGci[i] != 0xF1F1F1F1);
ndbrequire(readReplicaPtr.p->replicaLastGci[i] != 0xF1F1F1F1);
}//for
- for(Uint32 i = noCrashedReplicas; i<8; i++){
+ for(i = noCrashedReplicas; i<8; i++){
readReplicaPtr.p->createGci[i] = readPageWord(rf);
readReplicaPtr.p->replicaLastGci[i] = readPageWord(rf);
// They are not initialized...
@@ -11732,7 +11741,7 @@ void Dbdih::readReplica(RWFragment* rf, ReplicaRecordPtr readReplicaPtr)
/* WE ALSO HAVE TO INVALIDATE ANY LOCAL CHECKPOINTS THAT HAVE BEEN */
/* INVALIDATED BY MOVING BACK THE RESTART GCI. */
/* ---------------------------------------------------------------------- */
- for (Uint32 i = 0; i < MAX_LCP_STORED; i++) {
+ for (i = 0; i < MAX_LCP_STORED; i++) {
jam();
if ((readReplicaPtr.p->lcpStatus[i] == ZVALID) &&
(readReplicaPtr.p->maxGciStarted[i] > SYSFILE->newestRestorableGCI)) {
@@ -11764,6 +11773,7 @@ void Dbdih::readReplica(RWFragment* rf, ReplicaRecordPtr readReplicaPtr)
void Dbdih::readReplicas(RWFragment* rf, FragmentstorePtr fragPtr)
{
+ Uint32 i;
ReplicaRecordPtr newReplicaPtr;
Uint32 noStoredReplicas = fragPtr.p->noStoredReplicas;
Uint32 noOldStoredReplicas = fragPtr.p->noOldStoredReplicas;
@@ -11775,7 +11785,7 @@ void Dbdih::readReplicas(RWFragment* rf, FragmentstorePtr fragPtr)
fragPtr.p->noOldStoredReplicas = 0;
Uint32 replicaIndex = 0;
ndbrequire(noStoredReplicas + noOldStoredReplicas <= MAX_REPLICAS);
- for (Uint32 i = 0; i < noStoredReplicas; i++) {
+ for (i = 0; i < noStoredReplicas; i++) {
seizeReplicaRec(newReplicaPtr);
readReplica(rf, newReplicaPtr);
if (checkNodeAlive(newReplicaPtr.p->procNode)) {
@@ -11790,7 +11800,7 @@ void Dbdih::readReplicas(RWFragment* rf, FragmentstorePtr fragPtr)
}//if
}//for
fragPtr.p->fragReplicas = noStoredReplicas;
- for (Uint32 i = 0; i < noOldStoredReplicas; i++) {
+ for (i = 0; i < noOldStoredReplicas; i++) {
jam();
seizeReplicaRec(newReplicaPtr);
readReplica(rf, newReplicaPtr);
@@ -12640,11 +12650,11 @@ void Dbdih::setNodeRestartInfoBits()
NodeRecordPtr nodePtr;
Uint32 tsnrNodeGroup;
Uint32 tsnrNodeActiveStatus;
-
- for(int i = 1; i < MAX_NDB_NODES; i++){
+ Uint32 i;
+ for(i = 1; i < MAX_NDB_NODES; i++){
Sysfile::setNodeStatus(i, SYSFILE->nodeStatus, Sysfile::NS_Active);
}//for
- for(Uint32 i = 1; i < Sysfile::NODE_GROUPS_SIZE; i++){
+ for(i = 1; i < Sysfile::NODE_GROUPS_SIZE; i++){
SYSFILE->nodeGroups[i] = 0;
}//for
NdbNodeBitmask::clear(SYSFILE->lcpActive);
@@ -12786,13 +12796,14 @@ void Dbdih::writeReplicas(RWFragment* wf, Uint32 replicaStartIndex)
writePageWord(wf, wfReplicaPtr.p->initialGci);
writePageWord(wf, wfReplicaPtr.p->noCrashedReplicas);
writePageWord(wf, wfReplicaPtr.p->nextLcp);
- for (Uint32 i = 0; i < MAX_LCP_STORED; i++) {
+ Uint32 i;
+ for (i = 0; i < MAX_LCP_STORED; i++) {
writePageWord(wf, wfReplicaPtr.p->maxGciCompleted[i]);
writePageWord(wf, wfReplicaPtr.p->maxGciStarted[i]);
writePageWord(wf, wfReplicaPtr.p->lcpId[i]);
writePageWord(wf, wfReplicaPtr.p->lcpStatus[i]);
}//if
- for (Uint32 i = 0; i < 8; i++) {
+ for (i = 0; i < 8; i++) {
writePageWord(wf, wfReplicaPtr.p->createGci[i]);
writePageWord(wf, wfReplicaPtr.p->replicaLastGci[i]);
}//if
@@ -13003,7 +13014,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
}
if(signal->theData[0] == 7012){
- char buf[c_lcpState.m_participatingDIH.TextLength+1];
+ char buf[8*_NDB_NODE_BITMASK_SIZE+1];
infoEvent("ParticipatingDIH = %s", c_lcpState.m_participatingDIH.getText(buf));
infoEvent("ParticipatingLQH = %s", c_lcpState.m_participatingLQH.getText(buf));
infoEvent("m_LCP_COMPLETE_REP_Counter_DIH = %s",
@@ -13020,8 +13031,8 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
jam();
ptrAss(nodePtr, nodeRecord);
if(nodePtr.p->nodeStatus == NodeRecord::ALIVE){
-
- for(Uint32 i = 0; i<nodePtr.p->noOfStartedChkpt; i++){
+ Uint32 i;
+ for(i = 0; i<nodePtr.p->noOfStartedChkpt; i++){
infoEvent("Node %d: started: table=%d fragment=%d replica=%d",
nodePtr.i,
nodePtr.p->startedChkpt[i].tableId,
@@ -13029,7 +13040,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
nodePtr.p->startedChkpt[i].replicaPtr);
}
- for(Uint32 i = 0; i<nodePtr.p->noOfQueuedChkpt; i++){
+ for(i = 0; i<nodePtr.p->noOfQueuedChkpt; i++){
infoEvent("Node %d: queued: table=%d fragment=%d replica=%d",
nodePtr.i,
nodePtr.p->queuedChkpt[i].tableId,
diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
index f3a6ce8f994..eb8e2917a8e 100644
--- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
+++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
@@ -6387,12 +6387,13 @@ void Dblqh::execNODE_FAILREP(Signal* signal)
UintR TfoundNodes = 0;
UintR TnoOfNodes;
UintR Tdata[MAX_NDB_NODES];
+ Uint32 i;
NodeFailRep * const nodeFail = (NodeFailRep *)&signal->theData[0];
TnoOfNodes = nodeFail->noOfNodes;
UintR index = 0;
- for (Uint32 i = 1; i < MAX_NDB_NODES; i++) {
+ for (i = 1; i < MAX_NDB_NODES; i++) {
jam();
if(NodeBitmask::get(nodeFail->theNodes, i)){
jam();
@@ -6406,7 +6407,7 @@ void Dblqh::execNODE_FAILREP(Signal* signal)
ndbrequire(index == TnoOfNodes);
ndbrequire(cnoOfNodes - 1 < MAX_NDB_NODES);
- for (Uint32 i = 0; i < TnoOfNodes; i++) {
+ for (i = 0; i < TnoOfNodes; i++) {
const Uint32 nodeId = Tdata[i];
lcpPtr.p->m_EMPTY_LCP_REQ.clear(nodeId);
@@ -6604,7 +6605,7 @@ Dblqh::scanMarkers(Signal* signal,
}
const Uint32 RT_BREAK = 256;
- for(Uint32 i = 0; i<RT_BREAK || iter.bucket == startBucket; i++){
+ for(i = 0; i<RT_BREAK || iter.bucket == startBucket; i++){
jam();
if(iter.curr.i == RNIL){
@@ -13222,11 +13223,12 @@ void Dblqh::execSR_FRAGIDCONF(Signal* signal)
Uint32 noLocFrag = srFragidConf->noLocFrag;
ndbrequire(noLocFrag == 2);
Uint32 fragid[2];
- for (Uint32 i = 0; i < noLocFrag; i++) {
+ Uint32 i;
+ for (i = 0; i < noLocFrag; i++) {
fragid[i] = srFragidConf->fragId[i];
}//for
- for (Uint32 i = 0; i < noLocFrag; i++) {
+ for (i = 0; i < noLocFrag; i++) {
jam();
Uint32 fragId = fragid[i];
/* ----------------------------------------------------------------------
@@ -16177,17 +16179,18 @@ void Dblqh::initialisePageRef(Signal* signal)
void Dblqh::initialiseRecordsLab(Signal* signal, Uint32 data,
Uint32 retRef, Uint32 retData)
{
+ Uint32 i;
switch (data) {
case 0:
jam();
- for (Uint32 i = 0; i < MAX_NDB_NODES; i++) {
+ for (i = 0; i < MAX_NDB_NODES; i++) {
cnodeSrState[i] = ZSTART_SR;
cnodeExecSrState[i] = ZSTART_SR;
}//for
- for (Uint32 i = 0; i < 1024; i++) {
+ for (i = 0; i < 1024; i++) {
ctransidHash[i] = RNIL;
}//for
- for (Uint32 i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++) {
cactiveCopy[i] = RNIL;
}//for
cnoActiveCopy = 0;
@@ -18141,7 +18144,7 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal)
infoEvent(" lcpQueued=%d reportEmpty=%d",
TlcpPtr.p->lcpQueued,
TlcpPtr.p->reportEmpty);
- char buf[TlcpPtr.p->m_EMPTY_LCP_REQ.TextLength+1];
+ char buf[8*_NDB_NODE_BITMASK_SIZE+1];
infoEvent(" m_EMPTY_LCP_REQ=%d",
TlcpPtr.p->m_EMPTY_LCP_REQ.getText(buf));
diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
index 066fb24f09c..7d8d0f5fead 100644
--- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
@@ -6721,7 +6721,8 @@ void Dbtc::execNODE_FAILREP(Signal* signal)
tcNodeFailptr.i = 0;
ptrAss(tcNodeFailptr, tcFailRecord);
- for (Uint32 tindex = 0; tindex < tnoOfNodes; tindex++) {
+ Uint32 tindex;
+ for (tindex = 0; tindex < tnoOfNodes; tindex++) {
jam();
hostptr.i = cdata[tindex];
ptrCheckGuard(hostptr, chostFilesize, hostRecord);
@@ -6838,8 +6839,7 @@ void Dbtc::execNODE_FAILREP(Signal* signal)
}//if
}//for
}//if
-
- for (Uint32 tindex = 0; tindex < tnoOfNodes; tindex++) {
+ for (tindex = 0; tindex < tnoOfNodes; tindex++) {
jam();
hostptr.i = cdata[tindex];
ptrCheckGuard(hostptr, chostFilesize, hostRecord);
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp b/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp
index c38fde23404..930faf6d24a 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp
@@ -238,11 +238,12 @@ void Dbtup::execMEMCHECKREQ(Signal* signal)
ljamEntry();
BlockReference blockref = signal->theData[0];
- for (Uint32 i = 0; i < 25; i++) {
+ Uint32 i;
+ for (i = 0; i < 25; i++) {
ljam();
data[i] = 0;
}//for
- for (Uint32 i = 0; i < 16; i++) {
+ for (i = 0; i < 16; i++) {
regPagePtr.i = cfreepageList[i];
ljam();
while (regPagePtr.i != RNIL) {
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp b/ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp
index 580d764c96f..30701bdbe39 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp
@@ -494,16 +494,17 @@ void Dbtup::readExecUndoLogLab(Signal* signal, DiskBufferSegmentInfoPtr dbsiPtr,
Uint32 dataPages[16];
ndbrequire(dbsiPtr.p->pdxFilePage > 0);
ndbrequire(dbsiPtr.p->pdxFilePage <= ZUB_SEGMENT_SIZE);
- for (Uint32 i = 0; i < dbsiPtr.p->pdxFilePage; i++) {
+ Uint32 i;
+ for (i = 0; i < dbsiPtr.p->pdxFilePage; i++) {
ljam();
dataPages[i] = dbsiPtr.p->pdxDataPage[i + ZUB_SEGMENT_SIZE];
}//for
- for (Uint32 i = 0; i < ZUB_SEGMENT_SIZE; i++) {
+ for (i = 0; i < ZUB_SEGMENT_SIZE; i++) {
ljam();
dataPages[i + dbsiPtr.p->pdxFilePage] = dbsiPtr.p->pdxDataPage[i];
}//for
Uint32 limitLoop = ZUB_SEGMENT_SIZE + dbsiPtr.p->pdxFilePage;
- for (Uint32 i = 0; i < limitLoop; i++) {
+ for (i = 0; i < limitLoop; i++) {
ljam();
dbsiPtr.p->pdxDataPage[i] = dataPages[i];
}//for
@@ -977,7 +978,8 @@ void Dbtup::allocRestartUndoBufferSegment(Signal* signal, DiskBufferSegmentInfoP
seizeDiskBufferSegmentRecord(dbsiPtr);
dbsiPtr.p->pdxBuffertype = UNDO_RESTART_PAGES;
dbsiPtr.p->pdxUndoBufferSet[0] = undoPagePtr.i;
- for (Uint32 i = 0; i < ZUB_SEGMENT_SIZE; i++) {
+ Uint32 i;
+ for (i = 0; i < ZUB_SEGMENT_SIZE; i++) {
dbsiPtr.p->pdxDataPage[i] = undoPagePtr.i + i;
}//for
@@ -994,7 +996,7 @@ void Dbtup::allocRestartUndoBufferSegment(Signal* signal, DiskBufferSegmentInfoP
undoPagePtr.p->undoPageWord[ZPAGE_NEXT_POS] = RNIL;
dbsiPtr.p->pdxUndoBufferSet[1] = undoPagePtr.i;
// lliPtr.p->lliUndoPage = undoPagePtr.i;
- for (Uint32 i = ZUB_SEGMENT_SIZE; i < (2 * ZUB_SEGMENT_SIZE); i++) {
+ for (i = ZUB_SEGMENT_SIZE; i < (2 * ZUB_SEGMENT_SIZE); i++) {
dbsiPtr.p->pdxDataPage[i] = undoPagePtr.i + (i - ZUB_SEGMENT_SIZE);
}//for
return;
diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
index c5732eea01b..1a3c7f64ac3 100644
--- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
+++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
@@ -906,7 +906,7 @@ Dbtux::TreeHead::getSize(AccSize acc) const
case AccFull:
return m_nodeSize;
}
- REQUIRE(false, "invalid Dbtux::AccSize");
+ abort();
return 0;
}
diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp
index 83944f96b96..b30b555ccad 100644
--- a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp
+++ b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp
@@ -407,14 +407,15 @@ Dbtux::freeDescEnt(IndexPtr indexPtr)
index2.m_descPage == pagePtr.i &&
index2.m_descOff == off + size);
// move the entry (overlapping copy if size < size2)
- for (unsigned i = 0; i < size2; i++) {
+ unsigned i;
+ for (i = 0; i < size2; i++) {
jam();
data[off + i] = data[off + size + i];
}
off += size2;
// adjust page offset in index and all fragments
index2.m_descOff -= size;
- for (unsigned i = 0; i < index2.m_numFrags; i++) {
+ for (i = 0; i < index2.m_numFrags; i++) {
jam();
Frag& frag2 = *c_fragPool.getPtr(index2.m_fragPtrI[i]);
frag2.m_descOff -= size;
diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp
index e66bfc6d05c..3baa62998db 100644
--- a/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp
+++ b/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp
@@ -177,7 +177,8 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos)
nodePopDown(signal, node, pos, ent);
ndbrequire(node.getChilds() <= 1);
// handle half-leaf
- for (unsigned i = 0; i <= 1; i++) {
+ unsigned i;
+ for (i = 0; i <= 1; i++) {
jam();
TupLoc childLoc = node.getLink(i);
if (childLoc != NullTupLoc) {
@@ -191,7 +192,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos)
// get parent if any
TupLoc parentLoc = node.getLink(2);
NodeHandle parentNode(frag);
- unsigned i = node.getSide();
+ i = node.getSide();
// move all that fits into parent
if (parentLoc != NullTupLoc) {
jam();
diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
index 92410e1a784..ecaead3ba5a 100644
--- a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
+++ b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
@@ -2581,3 +2581,5 @@ DbUtil::execUTIL_DESTORY_LOCK_REQ(Signal* signal){
sendSignal(req.senderRef, GSN_UTIL_DESTROY_LOCK_REF, signal,
UtilDestroyLockRef::SignalLength, JBB);
}
+
+template class ArrayPool<DbUtil::Page32>;
diff --git a/ndb/src/kernel/blocks/grep/Grep.cpp b/ndb/src/kernel/blocks/grep/Grep.cpp
index ee506ce922a..8b93ef9cd20 100644
--- a/ndb/src/kernel/blocks/grep/Grep.cpp
+++ b/ndb/src/kernel/blocks/grep/Grep.cpp
@@ -73,7 +73,7 @@ Grep::getNodeGroupMembers(Signal* signal) {
c_noNodesInGroup++;
}
}
- ndbrequire(c_noNodesInGroup >= 0); // at least 1 node in the nodegroup
+ ndbrequire(c_noNodesInGroup > 0); // at least 1 node in the nodegroup
#ifdef NODEFAIL_DEBUG
for (Uint32 i = 0; i < c_noNodesInGroup; i++) {
@@ -253,7 +253,8 @@ Grep::execREAD_NODESCONF(Signal* signal)
/******************************
* Check which REP nodes exist
******************************/
- for (Uint32 i = 1; i < MAX_NODES; i++)
+ Uint32 i;
+ for (i = 1; i < MAX_NODES; i++)
{
jam();
#if 0
@@ -279,7 +280,7 @@ Grep::execREAD_NODESCONF(Signal* signal)
m_aliveNodes.clear();
Uint32 count = 0;
- for(Uint32 i = 0; i<MAX_NDB_NODES; i++)
+ for(i = 0; i<MAX_NDB_NODES; i++)
{
if (NodeBitmask::get(conf->allNodes, i))
{
diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
index 7ba7d0d25c6..f6607cdbdbb 100644
--- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
@@ -229,7 +229,7 @@ AsyncFile::run()
endReq();
return;
default:
- THREAD_REQUIRE(false, "Using default switch in AsyncFile::run");
+ abort();
break;
}//switch
theReportTo->writeChannel(request);
diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
index 435a6a6b208..03911d195ec 100644
--- a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
+++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
@@ -120,8 +120,7 @@ template <class T> void MemoryChannel<T>::writeChannel( T *t)
{
NdbMutex_Lock(theMutexPtr);
- REQUIRE(!full(theWriteIndex, theReadIndex), "Memory Channel Full");
- REQUIRE(theChannel != NULL, "Memory Channel Full");
+ if(full(theWriteIndex, theReadIndex) || theChannel == NULL) abort();
theChannel[theWriteIndex]= t;
++theWriteIndex;
NdbMutex_Unlock(theMutexPtr);
diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
index fe737fc584b..e38ae566430 100644
--- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
@@ -1010,3 +1010,6 @@ Ndbfs::execDUMP_STATE_ORD(Signal* signal)
BLOCK_FUNCTIONS(Ndbfs);
+template class Vector<AsyncFile*>;
+template class Vector<OpenFiles::OpenFileItem>;
+template class MemoryChannel<Request>;
diff --git a/ndb/src/kernel/blocks/ndbfs/Pool.hpp b/ndb/src/kernel/blocks/ndbfs/Pool.hpp
index a26fa730727..0410673af6f 100644
--- a/ndb/src/kernel/blocks/ndbfs/Pool.hpp
+++ b/ndb/src/kernel/blocks/ndbfs/Pool.hpp
@@ -215,7 +215,6 @@ protected:
T** tList = theList;
int i;
theList = new T*[aSize+theCurrentSize];
- REQUIRE(theList != 0, "Allocate in Pool.hpp failed");
// allocate full list
for (i = 0; i < theTop; i++) {
theList[i] = tList[i];
diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
index 9bf3bf06fa4..30f4d783c81 100644
--- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
+++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
@@ -2141,7 +2141,8 @@ void Qmgr::execPREP_FAILREQ(Signal* signal)
Uint16 TfailureNr = prepFail->failNo;
cnoPrepFailedNodes = prepFail->noOfNodes;
UintR arrayIndex = 0;
- for (Uint32 Tindex = 0; Tindex < MAX_NDB_NODES; Tindex++) {
+ Uint32 Tindex;
+ for (Tindex = 0; Tindex < MAX_NDB_NODES; Tindex++) {
if (NodeBitmask::get(prepFail->theNodes, Tindex)){
cprepFailedNodes[arrayIndex] = Tindex;
arrayIndex++;
@@ -2169,7 +2170,7 @@ void Qmgr::execPREP_FAILREQ(Signal* signal)
guard0 = cnoPrepFailedNodes - 1;
arrGuard(guard0, MAX_NDB_NODES);
- for (Uint32 Tindex = 0; Tindex <= guard0; Tindex++) {
+ for (Tindex = 0; Tindex <= guard0; Tindex++) {
jam();
failReport(signal,
cprepFailedNodes[Tindex],
diff --git a/ndb/src/kernel/blocks/suma/Suma.cpp b/ndb/src/kernel/blocks/suma/Suma.cpp
index 9718845de43..ec9dc4a3766 100644
--- a/ndb/src/kernel/blocks/suma/Suma.cpp
+++ b/ndb/src/kernel/blocks/suma/Suma.cpp
@@ -3972,3 +3972,6 @@ Suma::execSUMA_HANDOVER_CONF(Signal* signal) {
}
}
}
+
+template void append(DataBuffer<11>&,SegmentedSectionPtr,SectionSegmentPool&);
+
diff --git a/ndb/src/kernel/blocks/trix/Trix.cpp b/ndb/src/kernel/blocks/trix/Trix.cpp
index f058433840c..6cbc7a9b371 100644
--- a/ndb/src/kernel/blocks/trix/Trix.cpp
+++ b/ndb/src/kernel/blocks/trix/Trix.cpp
@@ -965,3 +965,5 @@ void Trix::checkParallelism(Signal* signal, SubscriptionRecord* subRec)
}
BLOCK_FUNCTIONS(Trix);
+
+template void append(DataBuffer<15>&,SegmentedSectionPtr,SectionSegmentPool&);
diff --git a/ndb/src/kernel/error/ErrorReporter.hpp b/ndb/src/kernel/error/ErrorReporter.hpp
index 3e2551d2056..2c79f242eea 100644
--- a/ndb/src/kernel/error/ErrorReporter.hpp
+++ b/ndb/src/kernel/error/ErrorReporter.hpp
@@ -23,35 +23,6 @@
#include "Error.hpp"
#include <Emulator.hpp>
-
-#ifdef ASSERT
-#undef ASSERT
-#endif
-
-#define REQUIRE(trueToContinue, message) \
- if ( (trueToContinue) ) { } else { \
- ErrorReporter::handleAssert(message, __FILE__, __LINE__); }
-
-#define THREAD_REQUIRE(trueToContinue, message) \
- if ( (trueToContinue) ) { } else { \
- ErrorReporter::handleThreadAssert(message, __FILE__, __LINE__); }
-
-#ifdef NDEBUG
-#define NDB_ASSERT(trueToContinue, message)
-#else
-#define NDB_ASSERT(trueToContinue, message) \
- if ( !(trueToContinue) ) { \
- ErrorReporter::handleAssert(message, __FILE__, __LINE__); }
-#endif
-
- // Description:
- // This macro is used to report programming errors.
- // Parameters:
- // trueToContinue IN An expression. If it evaluates to 0
- // execution is stopped.
- // message IN A message from the programmer
- // explaining what went wrong.
-
class ErrorReporter
{
public:
diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp
index e6c08b1b96f..f8e852b9d35 100644
--- a/ndb/src/kernel/main.cpp
+++ b/ndb/src/kernel/main.cpp
@@ -143,7 +143,7 @@ NDB_MAIN(ndb_kernel){
// Set thread concurrency for Solaris' light weight processes
int status;
status = NdbThread_SetConcurrencyLevel(30);
- NDB_ASSERT(status == 0, "Can't set appropriate concurrency level.");
+ assert(status == 0);
#ifdef VM_TRACE
// Create a signal logger
@@ -168,18 +168,22 @@ NDB_MAIN(ndb_kernel){
globalEmulatorData.theThreadConfig->doStart(NodeState::SL_STARTING);
break;
default:
- NDB_ASSERT(0, "Illegal state globalData.theRestartFlag");
+ assert("Illegal state globalData.theRestartFlag" == 0);
}
SocketServer socket_server;
globalTransporterRegistry.startSending();
globalTransporterRegistry.startReceiving();
- if (!globalTransporterRegistry.start_service(socket_server))
- NDB_ASSERT(0, "globalTransporterRegistry.start_service() failed");
+ if (!globalTransporterRegistry.start_service(socket_server)){
+ ndbout_c("globalTransporterRegistry.start_service() failed");
+ exit(-1);
+ }
- if (!globalTransporterRegistry.start_clients())
- NDB_ASSERT(0, "globalTransporterRegistry.start_clients() failed");
+ if (!globalTransporterRegistry.start_clients()){
+ ndbout_c("globalTransporterRegistry.start_clients() failed");
+ exit(-1);
+ }
globalEmulatorData.theWatchDog->doStart();
diff --git a/ndb/src/kernel/vm/ArrayPool.hpp b/ndb/src/kernel/vm/ArrayPool.hpp
index 4fc6bb97f73..c06f48f2e8e 100644
--- a/ndb/src/kernel/vm/ArrayPool.hpp
+++ b/ndb/src/kernel/vm/ArrayPool.hpp
@@ -153,6 +153,7 @@ public:
* (Run operator NdbOut<< on every element)
*/
void print(NdbOut & out){
+#ifdef VM_TRACE
out << "FirstFree = " << firstFree << endl;
for(Uint32 i = 0; i<size; i++){
#ifdef ARRAY_GUARD
@@ -164,6 +165,7 @@ public:
out << i << ": " << theArray[i] << " ";
}
out << endl;
+#endif
}
#ifdef DEBUG
diff --git a/ndb/src/kernel/vm/DataBuffer.hpp b/ndb/src/kernel/vm/DataBuffer.hpp
index 7dc89aa638c..7f553898eb5 100644
--- a/ndb/src/kernel/vm/DataBuffer.hpp
+++ b/ndb/src/kernel/vm/DataBuffer.hpp
@@ -33,7 +33,7 @@ public:
Uint32 data[sz];
NdbOut& print(NdbOut& out){
out << "[DataBuffer<" << sz << ">::Segment this="
- << hex << (Uint32)this << dec << " nextPool= "
+ << this << dec << " nextPool= "
<< nextPool << " ]";
return out;
}
diff --git a/ndb/src/kernel/vm/MetaData.cpp b/ndb/src/kernel/vm/MetaData.cpp
index bcde6c63272..51afbf21503 100644
--- a/ndb/src/kernel/vm/MetaData.cpp
+++ b/ndb/src/kernel/vm/MetaData.cpp
@@ -47,7 +47,7 @@ MetaData::MetaData(SimulatedBlock* block) :
MetaData::~MetaData()
{
for (int i = false; i <= true; i++) {
- NDB_ASSERT(m_common.m_lock[i] >= m_lock[i], "invalid lock count");
+ assert(m_common.m_lock[i] >= m_lock[i]);
m_common.m_lock[i] -= m_lock[i];
m_lock[i] = 0;
}
diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp
index a6a8a6242cd..cb3c5dc9d2c 100644
--- a/ndb/src/kernel/vm/SimulatedBlock.cpp
+++ b/ndb/src/kernel/vm/SimulatedBlock.cpp
@@ -136,12 +136,12 @@ SimulatedBlock::installSimulatedBlockFunctions(){
void
SimulatedBlock::addRecSignalImpl(GlobalSignalNumber gsn,
ExecFunction f, bool force){
- REQUIRE(gsn <= MAX_GSN, "Illegal signal added in block (GSN too high)");
- char probData[255];
- snprintf(probData, 255,
- "Signal (%d) already added in block",
- gsn);
- REQUIRE(force || theExecArray[gsn] == 0, probData);
+ if(gsn > MAX_GSN || (!force && theExecArray[gsn] != 0)){
+ char errorMsg[255];
+ snprintf(errorMsg, 255,
+ "Illeagal signal (%d %d)", gsn, MAX_GSN);
+ ERROR_SET(fatal, ERR_ERROR_PRGERR, errorMsg, errorMsg);
+ }
theExecArray[gsn] = f;
}
@@ -1005,7 +1005,8 @@ SimulatedBlock::assembleFragments(Signal * signal){
/**
* FragInfo == 2 or 3
*/
- for(Uint32 i = 0; i<secs; i++){
+ Uint32 i;
+ for(i = 0; i<secs; i++){
Uint32 sectionNo = secNos[i];
ndbassert(sectionNo < 3);
Uint32 sectionPtrI = signal->m_sectionPtr[i].i;
@@ -1027,7 +1028,6 @@ SimulatedBlock::assembleFragments(Signal * signal){
/**
* fragInfo = 3
*/
- Uint32 i;
for(i = 0; i<3; i++){
Uint32 ptrI = fragPtr.p->m_sectionPtrI[i];
if(ptrI != RNIL){
diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp
index 491d432625e..e3eac8c0e20 100644
--- a/ndb/src/kernel/vm/SimulatedBlock.hpp
+++ b/ndb/src/kernel/vm/SimulatedBlock.hpp
@@ -458,11 +458,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);
- REQUIRE(false, errorMsg);
+ ERROR_SET(fatal, ERR_ERROR_PRGERR, errorMsg, errorMsg);
}
if (!(theExecArray[gsn] != 0)) {
snprintf(errorMsg, 255, "Illegal signal received (GSN %d not added)", gsn);
- REQUIRE(false, errorMsg);
+ ERROR_SET(fatal, ERR_ERROR_PRGERR, errorMsg, errorMsg);
}
ndbrequire(false);
}
diff --git a/ndb/src/kernel/vm/TransporterCallback.cpp b/ndb/src/kernel/vm/TransporterCallback.cpp
index eb7d138895c..158de64c87f 100644
--- a/ndb/src/kernel/vm/TransporterCallback.cpp
+++ b/ndb/src/kernel/vm/TransporterCallback.cpp
@@ -434,5 +434,28 @@ reportDisconnect(void * callbackObj, NodeId nodeId, Uint32 errNo){
globalScheduler.execute(&signal, JBA, CMVMI, GSN_DISCONNECT_REP);
}
-
+void
+SignalLoggerManager::printSegmentedSection(FILE * output,
+ const SignalHeader & sh,
+ const SegmentedSectionPtr ptr[3],
+ unsigned i)
+{
+ fprintf(output, "SECTION %u type=segmented", i);
+ if (i >= 3) {
+ fprintf(output, " *** invalid ***\n");
+ return;
+ }
+ const Uint32 len = ptr[i].sz;
+ SectionSegment * ssp = ptr[i].p;
+ Uint32 pos = 0;
+ fprintf(output, " size=%u\n", (unsigned)len);
+ while (pos < len) {
+ if (pos > 0 && pos % SectionSegment::DataLength == 0) {
+ ssp = g_sectionSegmentPool.getPtr(ssp->m_nextSegment);
+ }
+ printDataWord(output, pos, ssp->theData[pos % SectionSegment::DataLength]);
+ }
+ if (len > 0)
+ putc('\n', output);
+}
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp
index 8f0c9e3ccf7..963e159424a 100644
--- a/ndb/src/mgmapi/mgmapi.cpp
+++ b/ndb/src/mgmapi/mgmapi.cpp
@@ -64,7 +64,7 @@
0, \
0, 0 }
-class ParserDummy : SocketServer::Session
+class ParserDummy : private SocketServer::Session
{
public:
ParserDummy(NDB_SOCKET_TYPE sock);
@@ -473,11 +473,12 @@ extern "C"
const char *
ndb_mgm_get_node_status_string(enum ndb_mgm_node_status status)
{
- for(int i = 0; i<no_of_status_values; i++)
+ int i;
+ for(i = 0; i<no_of_status_values; i++)
if(status_values[i].value == status)
return status_values[i].str;
- for(int i = 0; i<no_of_status_values; i++)
+ for(i = 0; i<no_of_status_values; i++)
if(status_values[i].value == NDB_MGM_NODE_STATUS_UNKNOWN)
return status_values[i].str;
@@ -1591,3 +1592,5 @@ ndb_mgm_rep_command(NdbMgmHandle handle, unsigned int request,
delete reply;
return 0;
}
+
+template class Vector<const ParserRow<ParserDummy>*>;
diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp
index cf9d885847a..fe9be9bcd44 100644
--- a/ndb/src/mgmclient/CommandInterpreter.cpp
+++ b/ndb/src/mgmclient/CommandInterpreter.cpp
@@ -634,7 +634,8 @@ CommandInterpreter::executeHelp(char* parameters)
void
CommandInterpreter::executeShow(char* parameters)
-{
+{
+ int i;
connect();
if (emptyString(parameters)) {
ndbout << "Cluster Configuration" << endl
@@ -652,7 +653,7 @@ CommandInterpreter::executeShow(char* parameters)
api_nodes = 0,
mgm_nodes = 0;
- for(int i=0; i < state->no_of_nodes; i++) {
+ for(i=0; i < state->no_of_nodes; i++) {
switch(state->node_states[i].node_type) {
case NDB_MGM_NODE_TYPE_API:
api_nodes++;
@@ -673,7 +674,7 @@ CommandInterpreter::executeShow(char* parameters)
<< " NDB Node(s)"
<< endl;
- for(int i=0; i < state->no_of_nodes; i++) {
+ for(i=0; i < state->no_of_nodes; i++) {
if(state->node_states[i].node_type == NDB_MGM_NODE_TYPE_NDB) {
ndbout << "DB node:\t" << state->node_states[i].node_id;
if(state->node_states[i].version != 0) {
@@ -695,7 +696,7 @@ CommandInterpreter::executeShow(char* parameters)
<< " API Node(s)"
<< endl;
- for(int i=0; i < state->no_of_nodes; i++) {
+ for(i=0; i < state->no_of_nodes; i++) {
if(state->node_states[i].node_type == NDB_MGM_NODE_TYPE_API) {
ndbout << "API node:\t" << state->node_states[i].node_id;
if(state->node_states[i].version != 0) {
@@ -716,7 +717,7 @@ CommandInterpreter::executeShow(char* parameters)
<< " MGM Node(s)"
<< endl;
- for(int i=0; i < state->no_of_nodes; i++) {
+ for(i=0; i < state->no_of_nodes; i++) {
if(state->node_states[i].node_type == NDB_MGM_NODE_TYPE_MGM) {
ndbout << "MGM node:\t" << state->node_states[i].node_id;
if(state->node_states[i].version != 0) {
@@ -759,6 +760,7 @@ CommandInterpreter::executeShow(char* parameters)
void
CommandInterpreter::executeClusterLog(char* parameters)
{
+ int i;
connect();
if (parameters != 0 && strlen(parameters) != 0) {
enum ndb_mgm_clusterlog_level severity = NDB_MGM_CLUSTERLOG_ALL;
@@ -846,10 +848,10 @@ CommandInterpreter::executeClusterLog(char* parameters)
ndbout << "Cluster logging is disabled." << endl;
- for(int i = 0; i<7;i++)
+ for(i = 0; i<7;i++)
printf("enabled[%d] = %d\n", i, enabled[i]);
ndbout << "Severities enabled: ";
- for(int i = 1; i < 7; i++) {
+ for(i = 1; i < 7; i++) {
if(enabled[i])
ndbout << names[i] << " ";
}
@@ -1298,14 +1300,15 @@ CommandInterpreter::executeLog(int processId,
return;
}
int len=0;
- for(Uint32 i=0; i<blocks.size(); i++) {
+ Uint32 i;
+ for(i=0; i<blocks.size(); i++) {
ndbout_c("blocks %s %d",blocks[i], strlen(blocks[i]));
len += strlen(blocks[i]);
}
len += blocks.size()*2;
char * blockNames = (char*)malloc(len);
- for(Uint32 i=0; i<blocks.size(); i++) {
+ for(i=0; i<blocks.size(); i++) {
strcat(blockNames, blocks[i]);
strcat(blockNames, "|");
}
@@ -1478,7 +1481,7 @@ CommandInterpreter::executeSet(int /*processId*/,
<< endl;
}
else {
- NDB_ASSERT(false, "");
+ assert(false);
}
}
else {
@@ -1497,7 +1500,7 @@ CommandInterpreter::executeSet(int /*processId*/,
}
else {
// The primary is not tried to write if the write of backup file fails
- NDB_ASSERT(false, "");
+ abort();
}
}
free(newpar);
diff --git a/ndb/src/mgmclient/CpcClient.cpp b/ndb/src/mgmclient/CpcClient.cpp
index f11aa797ff1..47e336e2749 100644
--- a/ndb/src/mgmclient/CpcClient.cpp
+++ b/ndb/src/mgmclient/CpcClient.cpp
@@ -557,4 +557,5 @@ SimpleCpcClient::cpc_call(const char *cmd,
SimpleCpcClient::ParserDummy::ParserDummy(NDB_SOCKET_TYPE sock)
: SocketServer::Session(sock) {
}
-
+
+template class Vector<SimpleCpcClient::Process>;
diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp
index 004fc463b70..316b6d5795e 100644
--- a/ndb/src/mgmsrv/CommandInterpreter.cpp
+++ b/ndb/src/mgmsrv/CommandInterpreter.cpp
@@ -378,7 +378,8 @@ void CommandInterpreter::executeHelp(char* parameters) {
(void)parameters; // Don't want compiler warning
if (emptyString(parameters)) {
- for (int i = 0; i<noOfHelpTexts; i++) {
+ unsigned i;
+ for (i = 0; i<noOfHelpTexts; i++) {
ndbout << helpTexts[i] << endl;
}
@@ -388,7 +389,7 @@ void CommandInterpreter::executeHelp(char* parameters) {
<< endl;
ndbout << "<category> = ";
- for(Uint32 i = 0; i<EventLogger::noOfEventCategoryNames; i++){
+ for(i = 0; i<EventLogger::noOfEventCategoryNames; i++){
ndbout << EventLogger::eventCategoryNames[i].name;
if (i < EventLogger::noOfEventCategoryNames - 1) {
ndbout << " | ";
@@ -1195,11 +1196,12 @@ CommandInterpreter::jonas(int processId, const char* parameters, bool all) {
data[0] = 12;
data[1] = 13;
-
- for(Uint32 i = 0; i<70; i++)
+
+ unsigned i;
+ for(i = 0; i<70; i++)
sec0[i] = i;
- for(Uint32 i = 0; i<123; i++)
+ for(i = 0; i<123; i++)
sec1[i] = 70+i;
signal.set(0, CMVMI, GSN_TESTSIG, 3);
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp
index 2fe4624ab59..ccc63cc7e70 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -250,14 +250,12 @@ MgmtSrvr::startEventLog()
}
ndb_mgm_destroy_iterator(iter);
- if(logdest.length()==0) {
+ if(logdest.length() == 0 || logdest == "") {
logdest.assfmt("FILE:filename=%s,maxsize=1000000,maxfiles=6",
clusterLog);
}
-
if(!g_EventLogger.addHandler(logdest)) {
- ndbout << "ERROR: cannot parse \"" << logdest << "\"" << endl;
- exit(1);
+ ndbout << "Warning: could not add log destination \"" << logdest.c_str() << "\"" << endl;
}
}
@@ -594,8 +592,10 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
_ownNodeId= 0; // did not get nodeid requested
}
m_allocated_resources.reserve_node(_ownNodeId);
- } else
- NDB_ASSERT(0, "Unable to retrieve own node id");
+ } else {
+ ndbout_c("Unable to retrieve own node id");
+ exit(-1);
+ }
}
@@ -1098,13 +1098,13 @@ MgmtSrvr::version(int * stopCount, bool abort,
m_versionRec.callback = callback;
m_versionRec.inUse = true ;
-
- for(Uint32 i = 0; i<MAX_NODES; i++) {
+ Uint32 i;
+ for(i = 0; i<MAX_NODES; i++) {
if (getNodeType(i) == NDB_MGM_NODE_TYPE_MGM) {
m_versionRec.callback(i, NDB_VERSION, this,0);
}
}
- for(Uint32 i = 0; i<MAX_NODES; i++) {
+ for(i = 0; i<MAX_NODES; i++) {
if (getNodeType(i) == NDB_MGM_NODE_TYPE_NDB) {
node = theFacade->theClusterMgr->getNodeInfo(i);
version = node.m_info.m_version;
@@ -1115,7 +1115,7 @@ MgmtSrvr::version(int * stopCount, bool abort,
}
}
- for(Uint32 i = 0; i<MAX_NODES; i++) {
+ for(i = 0; i<MAX_NODES; i++) {
if (getNodeType(i) == NDB_MGM_NODE_TYPE_API) {
return sendVersionReq(i);
}
@@ -1575,7 +1575,8 @@ MgmtSrvr::setEventReportingLevelImpl(int processId,
const SetLogLevelOrd & ll,
bool isResend)
{
- for(Uint32 i = 0; i<ll.noOfEntries; i++){
+ Uint32 i;
+ for(i = 0; i<ll.noOfEntries; i++){
// Save log level for the cluster log
if (!isResend) {
NodeLogLevel* n = NULL;
@@ -1606,7 +1607,7 @@ MgmtSrvr::setEventReportingLevelImpl(int processId,
EventSubscribeReq * dst =
CAST_PTR(EventSubscribeReq, signal->getDataPtrSend());
- for(Uint32 i = 0; i<ll.noOfEntries; i++){
+ for(i = 0; i<ll.noOfEntries; i++){
dst->theCategories[i] = ll.theCategories[i];
dst->theLevels[i] = ll.theLevels[i];
}
@@ -1635,7 +1636,8 @@ int
MgmtSrvr::setNodeLogLevel(int processId, const SetLogLevelOrd & ll,
bool isResend)
{
- for(Uint32 i = 0; i<ll.noOfEntries; i++){
+ Uint32 i;
+ for(i = 0; i<ll.noOfEntries; i++){
// Save log level for the cluster log
if (!isResend) {
NodeLogLevel* n = NULL;
@@ -1666,7 +1668,7 @@ MgmtSrvr::setNodeLogLevel(int processId, const SetLogLevelOrd & ll,
SetLogLevelOrd * dst = CAST_PTR(SetLogLevelOrd, signal->getDataPtrSend());
- for(Uint32 i = 0; i<ll.noOfEntries; i++){
+ for(i = 0; i<ll.noOfEntries; i++){
dst->theCategories[i] = ll.theCategories[i];
dst->theLevels[i] = ll.theLevels[i];
}
@@ -1810,7 +1812,7 @@ MgmtSrvr::setSignalLoggingMode(int processId, LogMode mode,
logSpec = TestOrd::InputOutputSignals;
break;
default:
- NDB_ASSERT(false, "Unexpected value, MgmtSrvr::setSignalLoggingMode");
+ assert("Unexpected value, MgmtSrvr::setSignalLoggingMode" == 0);
}
NdbApiSignal* signal = getSignal();
diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp
index c94e1455554..4a1b5d71898 100644
--- a/ndb/src/mgmsrv/Services.cpp
+++ b/ndb/src/mgmsrv/Services.cpp
@@ -1225,7 +1225,8 @@ void
MgmStatService::println_statistics(const BaseString &line){
MutexVector<NDB_SOCKET_TYPE> copy(m_sockets.size());
m_sockets.lock();
- for(int i = m_sockets.size() - 1; i >= 0; i--){
+ int i;
+ for(i = m_sockets.size() - 1; i >= 0; i--){
if(println_socket(m_sockets[i], MAX_WRITE_TIMEOUT, line.c_str()) == -1){
copy.push_back(m_sockets[i]);
m_sockets.erase(i, false);
@@ -1233,7 +1234,7 @@ MgmStatService::println_statistics(const BaseString &line){
}
m_sockets.unlock();
- for(int i = copy.size() - 1; i >= 0; i--){
+ for(i = copy.size() - 1; i >= 0; i--){
NDB_CLOSE_SOCKET(copy[i]);
copy.erase(i);
}
diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp
index f6f2106f2aa..5f620f77906 100644
--- a/ndb/src/ndbapi/DictCache.cpp
+++ b/ndb/src/ndbapi/DictCache.cpp
@@ -157,6 +157,7 @@ GlobalDictCache::put(const char * name, NdbTableImpl * tab)
void
GlobalDictCache::drop(NdbTableImpl * tab)
{
+ unsigned i;
const Uint32 len = strlen(tab->m_internalName.c_str());
Vector<TableVersion> * vers =
m_tableHash.getData(tab->m_internalName.c_str(), len);
@@ -173,7 +174,7 @@ GlobalDictCache::drop(NdbTableImpl * tab)
abort();
}
- for(unsigned i = 0; i < sz; i++){
+ for(i = 0; i < sz; i++){
TableVersion & ver = (* vers)[i];
if(ver.m_impl == tab){
if(ver.m_refCount == 0 || ver.m_status == RETREIVING ||
@@ -193,7 +194,7 @@ GlobalDictCache::drop(NdbTableImpl * tab)
}
}
- for(unsigned i = 0; i<sz; i++){
+ for(i = 0; i<sz; i++){
TableVersion & ver = (* vers)[i];
ndbout_c("%d: version: %d refCount: %d status: %d impl: %p",
i, ver.m_version, ver.m_refCount, ver.m_status, ver.m_impl);
@@ -204,6 +205,7 @@ GlobalDictCache::drop(NdbTableImpl * tab)
void
GlobalDictCache::release(NdbTableImpl * tab){
+ unsigned i;
const Uint32 len = strlen(tab->m_internalName.c_str());
Vector<TableVersion> * vers =
m_tableHash.getData(tab->m_internalName.c_str(), len);
@@ -220,7 +222,7 @@ GlobalDictCache::release(NdbTableImpl * tab){
abort();
}
- for(unsigned i = 0; i < sz; i++){
+ for(i = 0; i < sz; i++){
TableVersion & ver = (* vers)[i];
if(ver.m_impl == tab){
if(ver.m_refCount == 0 || ver.m_status == RETREIVING ||
@@ -235,7 +237,7 @@ GlobalDictCache::release(NdbTableImpl * tab){
}
}
- for(unsigned i = 0; i<sz; i++){
+ for(i = 0; i<sz; i++){
TableVersion & ver = (* vers)[i];
ndbout_c("%d: version: %d refCount: %d status: %d impl: %p",
i, ver.m_version, ver.m_refCount, ver.m_status, ver.m_impl);
@@ -244,3 +246,4 @@ GlobalDictCache::release(NdbTableImpl * tab){
abort();
}
+template class Vector<GlobalDictCache::TableVersion>;
diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp
index 5fff137b54f..9c86d382f8f 100644
--- a/ndb/src/ndbapi/Ndb.cpp
+++ b/ndb/src/ndbapi/Ndb.cpp
@@ -958,13 +958,13 @@ Ndb::StartTransactionNodeSelectionData::init(Uint32 noOfNodes,
*/
{
fragment2PrimaryNodeMap = new Uint32[noOfFragments];
-
- for(Uint32 i = 0; i<noOfNodes; i++){
+ Uint32 i;
+ for(i = 0; i<noOfNodes; i++){
fragment2PrimaryNodeMap[i] = nodeIds[i];
}
// Sort them (bubble sort)
- for(Uint32 i = 0; i<noOfNodes-1; i++)
+ for(i = 0; i<noOfNodes-1; i++)
for(Uint32 j = i+1; j<noOfNodes; j++)
if(fragment2PrimaryNodeMap[i] > fragment2PrimaryNodeMap[j]){
Uint32 tmp = fragment2PrimaryNodeMap[i];
@@ -972,7 +972,7 @@ Ndb::StartTransactionNodeSelectionData::init(Uint32 noOfNodes,
fragment2PrimaryNodeMap[j] = tmp;
}
- for(Uint32 i = 0; i<noOfNodes; i++){
+ for(i = 0; i<noOfNodes; i++){
fragment2PrimaryNodeMap[i+noOfNodes] = fragment2PrimaryNodeMap[i];
}
}
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index 004ad531b65..6e95f5c5622 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -383,7 +383,8 @@ void
NdbTableImpl::buildColumnHash(){
const Uint32 size = m_columns.size();
- for(size_t i = 31; i >= 0; i--){
+ size_t i;
+ for(i = 31; i >= 0; i--){
if(((1 << i) & size) != 0){
m_columnHashMask = (1 << (i + 1)) - 1;
break;
@@ -392,7 +393,7 @@ NdbTableImpl::buildColumnHash(){
Vector<Uint32> hashValues;
Vector<Vector<Uint32> > chains; chains.fill(size, hashValues);
- for(size_t i = 0; i<size; i++){
+ for(i = 0; i<size; i++){
Uint32 hv = Hash(m_columns[i]->getName()) & 0xFFFE;
Uint32 bucket = hv & m_columnHashMask;
bucket = (bucket < size ? bucket : bucket - size);
@@ -406,7 +407,7 @@ NdbTableImpl::buildColumnHash(){
m_columnHash.fill((unsigned)size-1, tmp); // Default no chaining
Uint32 pos = 0; // In overflow vector
- for(size_t i = 0; i<size; i++){
+ for(i = 0; i<size; i++){
Uint32 sz = chains[i].size();
if(sz == 1){
Uint32 col = chains[i][0];
@@ -1314,6 +1315,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
NdbTableImpl & impl,
bool alter)
{
+ unsigned i;
if((unsigned)impl.getNoOfPrimaryKeys() > NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY){
m_error.code = 4317;
return -1;
@@ -1339,7 +1341,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
bool haveAutoIncrement = false;
Uint64 autoIncrementValue;
- for(unsigned i = 0; i<sz; i++){
+ for(i = 0; i<sz; i++){
const NdbColumnImpl * col = impl.m_columns[i];
if(col == 0)
continue;
@@ -1383,7 +1385,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
abort();
}
- for(unsigned i = 0; i<sz; i++){
+ for(i = 0; i<sz; i++){
const NdbColumnImpl * col = impl.m_columns[i];
if(col == 0)
continue;
@@ -1795,7 +1797,7 @@ NdbDictInterface::createIndex(Ndb & ndb,
{
//validate();
//aggregate();
-
+ unsigned i;
UtilBufferWriter w(m_buffer);
const size_t len = strlen(impl.m_externalName.c_str()) + 1;
if(len > MAX_TAB_NAME_SIZE) {
@@ -1835,7 +1837,7 @@ NdbDictInterface::createIndex(Ndb & ndb,
req->setOnline(true);
AttributeList attributeList;
attributeList.sz = impl.m_columns.size();
- for(unsigned i = 0; i<attributeList.sz; i++){
+ for(i = 0; i<attributeList.sz; i++){
const NdbColumnImpl* col =
table.getColumn(impl.m_columns[i]->m_name.c_str());
if(col == 0){
@@ -1860,7 +1862,7 @@ NdbDictInterface::createIndex(Ndb & ndb,
}
if (it == DictTabInfo::UniqueHashIndex) {
// Sort index attributes according to primary table (using insertion sort)
- for(unsigned i = 1; i < attributeList.sz; i++) {
+ for(i = 1; i < attributeList.sz; i++) {
unsigned int temp = attributeList.id[i];
unsigned int j = i;
while((j > 0) && (attributeList.id[j - 1] > temp)) {
@@ -1870,7 +1872,7 @@ NdbDictInterface::createIndex(Ndb & ndb,
attributeList.id[j] = temp;
}
// Check for illegal duplicate attributes
- for(unsigned i = 0; i<attributeList.sz; i++) {
+ for(i = 0; i<attributeList.sz; i++) {
if ((i != (attributeList.sz - 1)) &&
(attributeList.id[i] == attributeList.id[i+1])) {
m_error.code = 4258;
@@ -2050,6 +2052,7 @@ NdbDictInterface::execDROP_INDX_REF(NdbApiSignal * signal,
int
NdbDictionaryImpl::createEvent(NdbEventImpl & evnt)
{
+ int i;
NdbTableImpl* tab = getTable(evnt.getTable());
if(tab == 0){
@@ -2072,7 +2075,7 @@ NdbDictionaryImpl::createEvent(NdbEventImpl & evnt)
int attributeList_sz = evnt.m_attrIds.size();
- for (int i = 0; i < attributeList_sz; i++) {
+ for (i = 0; i < attributeList_sz; i++) {
NdbColumnImpl *col_impl = table.getColumn(evnt.m_attrIds[i]);
if (col_impl) {
evnt.m_facade->addColumn(*(col_impl->m_facade));
@@ -2093,7 +2096,7 @@ NdbDictionaryImpl::createEvent(NdbEventImpl & evnt)
int pk_count = 0;
evnt.m_attrListBitmask.clear();
- for(int i = 0; i<attributeList_sz; i++){
+ for(i = 0; i<attributeList_sz; i++){
const NdbColumnImpl* col =
table.getColumn(evnt.m_columns[i]->m_name.c_str());
if(col == 0){
@@ -2111,7 +2114,7 @@ NdbDictionaryImpl::createEvent(NdbEventImpl & evnt)
}
// Sort index attributes according to primary table (using insertion sort)
- for(int i = 1; i < attributeList_sz; i++) {
+ for(i = 1; i < attributeList_sz; i++) {
NdbColumnImpl* temp = evnt.m_columns[i];
unsigned int j = i;
while((j > 0) && (evnt.m_columns[j - 1]->m_attrId > temp->m_attrId)) {
@@ -2121,7 +2124,7 @@ NdbDictionaryImpl::createEvent(NdbEventImpl & evnt)
evnt.m_columns[j] = temp;
}
// Check for illegal duplicate attributes
- for(int i = 1; i<attributeList_sz; i++) {
+ for(i = 1; i<attributeList_sz; i++) {
if (evnt.m_columns[i-1]->m_attrId == evnt.m_columns[i]->m_attrId) {
m_error.code = 4258;
return -1;
@@ -2818,3 +2821,10 @@ NdbDictInterface::execLIST_TABLES_CONF(NdbApiSignal* signal,
m_waiter.signal(NO_WAIT);
}
}
+
+template class Vector<int>;
+template class Vector<Uint32>;
+template class Vector<Vector<Uint32> >;
+template class Vector<NdbTableImpl*>;
+template class Vector<NdbColumnImpl*>;
+
diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/ndb/src/ndbapi/NdbEventOperationImpl.cpp
index 6730b637684..f5e683b1c29 100644
--- a/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+++ b/ndb/src/ndbapi/NdbEventOperationImpl.cpp
@@ -93,11 +93,12 @@ NdbEventOperationImpl::NdbEventOperationImpl(NdbEventOperation &N,
NdbEventOperationImpl::~NdbEventOperationImpl()
{
+ int i;
if (sdata) NdbMem_Free(sdata);
- for (int i=0 ; i<3; i++) {
+ for (i=0 ; i<3; i++) {
if (ptr[i].p) NdbMem_Free(ptr[i].p);
}
- for (int i=0 ; i<2; i++) {
+ for (i=0 ; i<2; i++) {
NdbRecAttr *p = theFirstRecAttrs[i];
while (p) {
NdbRecAttr *p_next = p->next();
@@ -1225,8 +1226,9 @@ NdbGlobalEventBuffer::real_wait(NdbGlobalEventBufferHandle *h,
int aMillisecondNumber)
{
// check if there are anything in any of the buffers
+ int i;
int n = 0;
- for (int i = 0; i < h->m_nids; i++)
+ for (i = 0; i < h->m_nids; i++)
n += hasData(h->m_bufferIds[i]);
if (n) return n;
@@ -1235,7 +1237,9 @@ NdbGlobalEventBuffer::real_wait(NdbGlobalEventBufferHandle *h,
return -1;
n = 0;
- for (int i = 0; i < h->m_nids; i++)
+ for (i = 0; i < h->m_nids; i++)
n += hasData(h->m_bufferIds[i]);
return n;
}
+
+template class Vector<NdbGlobalEventBufferHandle*>;
diff --git a/ndb/src/ndbapi/NdbLinHash.hpp b/ndb/src/ndbapi/NdbLinHash.hpp
index f67d4e60200..5d0d52a31d8 100644
--- a/ndb/src/ndbapi/NdbLinHash.hpp
+++ b/ndb/src/ndbapi/NdbLinHash.hpp
@@ -165,13 +165,14 @@ NdbLinHash<C>::createHashTable() {
max = SEGMENTSIZE - 1;
slack = SEGMENTSIZE * MAXLOADFCTR;
directory[0] = new Segment_t();
-
+ int i;
+
/* The first segment cleared before used */
- for(int i = 0; i < SEGMENTSIZE; i++ )
+ for(i = 0; i < SEGMENTSIZE; i++ )
directory[0]->elements[i] = 0;
/* clear the rest of the directory */
- for( int i = 1; i < DIRECTORYSIZE; i++)
+ for(i = 1; i < DIRECTORYSIZE; i++)
directory[i] = 0;
}
@@ -203,7 +204,8 @@ NdbLinHash<C>::insertKey( const char* str, Uint32 len, Uint32 lkey1, C* data )
* chain=chainp will copy the contents of HASH_T into chain
*/
NdbElement_t<C> * oldChain = 0;
- for(NdbElement_t<C> * chain = *chainp; chain != 0; chain = chain->next){
+ NdbElement_t<C> * chain;
+ for(chain = *chainp; chain != 0; chain = chain->next){
if(chain->len == len && !memcmp(chain->str, str, len))
return -1; /* Element already exists */
else
@@ -211,7 +213,7 @@ NdbLinHash<C>::insertKey( const char* str, Uint32 len, Uint32 lkey1, C* data )
}
/* New entry */
- NdbElement_t<C> * chain = new NdbElement_t<C>();
+ chain = new NdbElement_t<C>();
chain->len = len;
chain->hash = hash;
chain->localkey1 = lkey1;
diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp
index 9542b226d7d..eace1a0acf5 100644
--- a/ndb/src/ndbapi/NdbScanFilter.cpp
+++ b/ndb/src/ndbapi/NdbScanFilter.cpp
@@ -337,7 +337,6 @@ static const tab2 table2[] = {
const int tab_sz = sizeof(table)/sizeof(table[0]);
const int tab2_sz = sizeof(table2)/sizeof(table2[0]);
-template<typename T>
int
matchType(const NdbDictionary::Column * col){
return 1;
@@ -382,7 +381,7 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op,
return -1;
}
- if(!matchType<T>(col)){
+ if(!matchType(col)){
/**
* Code not reached
*/
@@ -777,3 +776,9 @@ main(void){
return 0;
}
#endif
+
+template class Vector<NdbScanFilterImpl::State>;
+template int NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition, Uint32 attrId, Uint32);
+template int NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition, Uint32 attrId, Uint64);
+
+
diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp
index f451ba885d4..641919d771b 100644
--- a/ndb/src/ndbapi/Ndbinit.cpp
+++ b/ndb/src/ndbapi/Ndbinit.cpp
@@ -111,12 +111,13 @@ Ndb::Ndb( const char* aDataBase , const char* aSchema) :
theCurrentConnectCounter = 1;
theCurrentConnectIndex = 0;
- for (int i = 0; i < MAX_NDB_NODES ; i++) {
+ int i;
+ for (i = 0; i < MAX_NDB_NODES ; i++) {
theConnectionArray[i] = NULL;
the_release_ind[i] = 0;
theDBnodes[i] = 0;
}//forg
- for (int i = 0; i < 2048 ; i++) {
+ for (i = 0; i < 2048 ; i++) {
theFirstTupleId[i] = 0;
theLastTupleId[i] = 0;
}//for
diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp
index 293136b9783..6a25db560c9 100644
--- a/ndb/src/ndbapi/TransporterFacade.cpp
+++ b/ndb/src/ndbapi/TransporterFacade.cpp
@@ -168,13 +168,6 @@ setSignalLog(){
#endif
#endif
-// These symbols are needed, but not used in the API
-int g_sectionSegmentPool;
-struct ErrorReporter {
- void handleAssert(const char*, const char*, int);
-};
-void ErrorReporter::handleAssert(const char*, const char*, int) {}
-
/**
* The execute function : Handle received signal
*/
@@ -318,6 +311,14 @@ execute(void * callbackObj, SignalHeader * const header,
}
}
+// These symbols are needed, but not used in the API
+void
+SignalLoggerManager::printSegmentedSection(FILE *, const SignalHeader &,
+ const SegmentedSectionPtr ptr[3],
+ unsigned i){
+ abort();
+}
+
void
copy(Uint32 * & insertPtr,
class SectionSegmentPool & thePool, const SegmentedSectionPtr & _ptr){
@@ -462,11 +463,15 @@ void TransporterFacade::threadMainSend(void)
SocketServer socket_server;
theTransporterRegistry->startSending();
- if (!theTransporterRegistry->start_service(socket_server))
- NDB_ASSERT(0, "Unable to start theTransporterRegistry->start_service");
+ if (!theTransporterRegistry->start_service(socket_server)){
+ ndbout_c("Unable to start theTransporterRegistry->start_service");
+ exit(0);
+ }
- if (!theTransporterRegistry->start_clients())
- NDB_ASSERT(0, "Unable to start theTransporterRegistry->start_clients");
+ if (!theTransporterRegistry->start_clients()){
+ ndbout_c("Unable to start theTransporterRegistry->start_clients");
+ exit(0);
+ }
socket_server.startServer();
@@ -1023,3 +1028,6 @@ TransporterFacade::ThreadData::close(int number){
m_statusFunction[number] = 0;
return 0;
}
+
+template class Vector<NodeStatusFunction>;
+template class Vector<TransporterFacade::ThreadData::Object_Execute>;