diff --git a/ndb/src/common/util/ConfigValues.cpp b/ndb/src/common/util/ConfigValues.cpp index b4cf6c9a919..7060c44f1eb 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; } @@ -261,9 +261,9 @@ directory(Uint32 sz){ ConfigValuesFactory::ConfigValuesFactory(Uint32 keys, Uint32 data){ m_sectionCounter = (1 << KP_SECTION_SHIFT); m_freeKeys = directory(keys); - m_freeData = data; + m_freeData = ((data + 7) & ~7); m_currentSection = 0; - m_cfg = create(m_freeKeys, data); + m_cfg = create(m_freeKeys, m_freeData); } ConfigValuesFactory::ConfigValuesFactory(ConfigValues * cfg){ @@ -316,7 +316,8 @@ ConfigValuesFactory::expand(Uint32 fk, Uint32 fs){ m_freeKeys = (m_freeKeys >= fk ? m_cfg->m_size : fk + m_cfg->m_size); m_freeData = (m_freeData >= fs ? m_cfg->m_dataSize : fs + m_cfg->m_dataSize); m_freeKeys = directory(m_freeKeys); - + m_freeData = ((m_freeData + 7) & ~7); + ConfigValues * m_tmp = m_cfg; m_cfg = create(m_freeKeys, m_freeData); put(* m_tmp); @@ -333,6 +334,7 @@ ConfigValuesFactory::shrink(){ m_freeKeys = m_cfg->m_size - m_freeKeys; m_freeData = m_cfg->m_dataSize - m_freeData; m_freeKeys = directory(m_freeKeys); + m_freeData = ((m_freeData + 7) & ~7); ConfigValues * m_tmp = m_cfg; m_cfg = create(m_freeKeys, m_freeData); @@ -462,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 *); diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index b51644b3940..717dc5083f0 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -243,20 +243,17 @@ MgmtSrvr::startEventLog() char clusterLog[MAXPATHLEN]; NdbConfig_ClusterLogFileName(clusterLog, sizeof(clusterLog)); - if(ndb_mgm_get_string_parameter(iter, CFG_LOG_DESTINATION, &tmp) == 0){ logdest.assign(tmp); } 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; } } 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 int matchType(const NdbDictionary::Column * col){ return 1; @@ -382,7 +381,7 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op, return -1; } - if(!matchType(col)){ + if(!matchType(col)){ /** * Code not reached */ @@ -777,3 +776,9 @@ main(void){ return 0; } #endif + +template class Vector; +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/test/src/HugoCalculator.cpp b/ndb/test/src/HugoCalculator.cpp index 55aa96a4909..147c8b104d8 100644 --- a/ndb/test/src/HugoCalculator.cpp +++ b/ndb/test/src/HugoCalculator.cpp @@ -28,7 +28,8 @@ HugoCalculator::HugoCalculator(const NdbDictionary::Table& tab) : m_tab(tab) { // The "id" column of this table is found in the first integer column - for (int i=0; igetType() == NdbDictionary::Column::Unsigned){ m_idCol = i; @@ -37,7 +38,7 @@ HugoCalculator::HugoCalculator(const NdbDictionary::Table& tab) : m_tab(tab) { } // The "number of updates" column for this table is found in the last column - for (int i=m_tab.getNoOfColumns()-1; i>=0; i--){ + for (i=m_tab.getNoOfColumns()-1; i>=0; i--){ const NdbDictionary::Column* attr = m_tab.getColumn(i); if (attr->getType() == NdbDictionary::Column::Unsigned){ m_updatesCol = i; @@ -102,7 +103,8 @@ HugoCalculator::calcValue(int record, // Fill buf with some pattern so that we can detect // anomalies in the area that we don't fill with chars - for (int i = 0; igetLength(); i++) + int i; + for (i = 0; igetLength(); i++) buf[i] = ((i+2) % 255); // Calculate length of the string to create. We want the string @@ -116,7 +118,7 @@ HugoCalculator::calcValue(int record, else len++; } - for(int i=0; i < len; i++) + for(i=0; i < len; i++) buf[i] = a[((val^i)%25)]; buf[len] = 0; } diff --git a/ndb/test/src/NDBT_Tables.cpp b/ndb/test/src/NDBT_Tables.cpp index 548e755a3fb..2031ddf5f04 100644 --- a/ndb/test/src/NDBT_Tables.cpp +++ b/ndb/test/src/NDBT_Tables.cpp @@ -678,17 +678,18 @@ NdbDictionary::Table* NDBT_Tables::getTable(const char* _nam){ // Search tables list to find a table NDBT_Table* tab = NULL; - for (int i=0; igetName(), _nam) == 0){ return test_tables[i]; } } - for (int i=0; igetName(), _nam) == 0){ return fail_tables[i]; } } - for (int i=0; igetName(), _nam) == 0){ return util_tables[i]; } diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp index 4cd2c96486b..1bb00138d3b 100644 --- a/ndb/test/src/NDBT_Test.cpp +++ b/ndb/test/src/NDBT_Test.cpp @@ -336,24 +336,24 @@ NDBT_TestCaseImpl1::NDBT_TestCaseImpl1(NDBT_TestSuite* psuite, NDBT_TestCaseImpl1::~NDBT_TestCaseImpl1(){ NdbCondition_Destroy(waitThreadsCondPtr); NdbMutex_Destroy(waitThreadsMutexPtr); - - for(size_t i = 0; i < initializers.size(); i++) + size_t i; + for(i = 0; i < initializers.size(); i++) delete initializers[i]; initializers.clear(); - for(size_t i = 0; i < verifiers.size(); i++) + for(i = 0; i < verifiers.size(); i++) delete verifiers[i]; verifiers.clear(); - for(size_t i = 0; i < finalizers.size(); i++) + for(i = 0; i < finalizers.size(); i++) delete finalizers[i]; finalizers.clear(); - for(size_t i = 0; i < steps.size(); i++) + for(i = 0; i < steps.size(); i++) delete steps[i]; steps.clear(); results.clear(); - for(size_t i = 0; i < testTables.size(); i++) + for(i = 0; i < testTables.size(); i++) delete testTables[i]; testTables.clear(); - for(size_t i = 0; i < testResults.size(); i++) + for(i = 0; i < testResults.size(); i++) delete testResults[i]; testResults.clear(); @@ -487,7 +487,8 @@ void NDBT_TestCaseImpl1::waitSteps(){ waitThreadsMutexPtr); unsigned completedSteps = 0; - for(unsigned i=0; iprint(); } - for(unsigned i=0; iprint(); } - for(unsigned i=0; iprint(); } - for(unsigned i=0; iprint(); } diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index 7ce2739a157..f3312b895c0 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -121,7 +121,8 @@ getStatus(){ retries++; continue; } - for (int i = 0; i < status->no_of_nodes; i++){ + int count = status->no_of_nodes; + for (int i = 0; i < count; i++){ node = &status->node_states[i]; switch(node->node_type){ case NDB_MGM_NODE_TYPE_NDB: @@ -142,7 +143,7 @@ getStatus(){ apiNodes.clear(); free(status); status = NULL; - i = status->no_of_nodes; + count = 0; ndbout << "kalle"<< endl; break;