diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 7485e42923e..294d32ac4be 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -205,7 +205,7 @@ if [ -f "$fs_ndb/$pidfile" ] ; then fi done kill_pids=$new_kill_pid - if [ "$kill_pids" == "" ] ; then + if [ -z "$kill_pids" ] ; then break fi sleep 1 diff --git a/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp index a9a50f19fbc..df0ac988e6e 100644 --- a/ndb/include/kernel/signaldata/DictTabInfo.hpp +++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -38,7 +38,7 @@ offsetof(x, l) } #define DTIBREAK(x) \ - { DictTabInfo::x, 0, SimpleProperties::InvalidValue, 0, 0 } + { DictTabInfo::x, 0, SimpleProperties::InvalidValue, 0, 0, 0 } class DictTabInfo { /** diff --git a/ndb/src/common/portlib/NdbDaemon.c b/ndb/src/common/portlib/NdbDaemon.c index d8d33595156..d2abb1da4cd 100644 --- a/ndb/src/common/portlib/NdbDaemon.c +++ b/ndb/src/common/portlib/NdbDaemon.c @@ -28,6 +28,8 @@ NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) int lockfd = -1, logfd = -1, n; char buf[64]; + (void)flags; // remove warning for unused parameter + /* Check that we have write access to lock file */ assert(lockfile != NULL); lockfd = open(lockfile, O_CREAT|O_RDWR, 0644); diff --git a/ndb/src/common/portlib/NdbMem.c b/ndb/src/common/portlib/NdbMem.c index c077d6650ce..c4ab62716da 100644 --- a/ndb/src/common/portlib/NdbMem.c +++ b/ndb/src/common/portlib/NdbMem.c @@ -42,6 +42,7 @@ void* NdbMem_Allocate(size_t size) void* NdbMem_AllocateAlign(size_t size, size_t alignment) { + (void)alignment; // remove warning for unused parameter /* return (void*)memalign(alignment, size); TEMP fix diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c index 60687a9053e..8fc077edcdc 100644 --- a/ndb/src/common/portlib/NdbThread.c +++ b/ndb/src/common/portlib/NdbThread.c @@ -42,6 +42,8 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, int result; pthread_attr_t thread_attr; + (void)thread_prio; // remove warning for unused parameter + if (p_thread_func == NULL) return 0; @@ -109,6 +111,7 @@ int NdbThread_SetConcurrencyLevel(int level) #ifdef USE_PTHREAD_EXTRAS return pthread_setconcurrency(level); #else + (void)level; // remove warning for unused parameter return 0; #endif } diff --git a/ndb/src/common/transporter/TCP_Transporter.cpp b/ndb/src/common/transporter/TCP_Transporter.cpp index 7cfdc224b34..524ecd653e0 100644 --- a/ndb/src/common/transporter/TCP_Transporter.cpp +++ b/ndb/src/common/transporter/TCP_Transporter.cpp @@ -362,7 +362,7 @@ TCP_Transporter::doReceive() { // Select-function must return the socket for read // before this method is called // It reads the external TCP/IP interface once - int size = receiveBuffer.sizeOfBuffer - receiveBuffer.sizeOfData; + Uint32 size = receiveBuffer.sizeOfBuffer - receiveBuffer.sizeOfData; if(size > 0){ const int nBytesRead = recv(theSocket, receiveBuffer.insertPtr, diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp index 7a469252c00..e68bc86718e 100644 --- a/ndb/src/common/transporter/Transporter.cpp +++ b/ndb/src/common/transporter/Transporter.cpp @@ -32,7 +32,7 @@ Transporter::Transporter(TransporterRegistry &t_reg, NodeId rNodeId, int _byteorder, bool _compression, bool _checksum, bool _signalId) - : m_r_port(r_port), localNodeId(lNodeId), remoteNodeId(rNodeId), + : m_r_port(r_port), remoteNodeId(rNodeId), localNodeId(lNodeId), isServer(lNodeId < rNodeId), m_packer(_signalId, _checksum), m_transporter_registry(t_reg) diff --git a/ndb/src/common/util/SimpleProperties.cpp b/ndb/src/common/util/SimpleProperties.cpp index c3980f03c4d..00c440fcb4e 100644 --- a/ndb/src/common/util/SimpleProperties.cpp +++ b/ndb/src/common/util/SimpleProperties.cpp @@ -293,7 +293,7 @@ SimpleProperties::Reader::printAll(NdbOut& ndbout){ break; default: ndbout << "Unknown type for key: " << getKey() - << " type: " << getValueType() << endl; + << " type: " << (Uint32)getValueType() << endl; } } } diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.cpp b/ndb/src/kernel/blocks/backup/restore/Restore.cpp index 9e1ad228ee5..ddd955fc96c 100644 --- a/ndb/src/kernel/blocks/backup/restore/Restore.cpp +++ b/ndb/src/kernel/blocks/backup/restore/Restore.cpp @@ -936,8 +936,9 @@ operator<<(NdbOut& ndbout, const TableS & table){ for (int j = 0; j < table.getNoOfAttributes(); j++) { const AttributeDesc * desc = table[j]; - ndbout << desc->m_column->getName() << ": " << desc->m_column->getType(); - ndbout << " key: " << desc->m_column->getPrimaryKey(); + ndbout << desc->m_column->getName() << ": " + << (Uint32) desc->m_column->getType(); + ndbout << " key: " << (Uint32) desc->m_column->getPrimaryKey(); ndbout << " array: " << desc->arraySize; ndbout << " size: " << desc->size << endl; } // for diff --git a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp index 3bf50026c4b..169b77c0d85 100644 --- a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp +++ b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp @@ -1087,10 +1087,10 @@ private: void deleteLongKey(Signal* signal); void removeFromPageArrayList(Signal* signal); void insertPageArrayList(Signal* signal); - void checkPageArrayList(Signal* signal, char *); - void checkPageB4Insert(Uint32, char *); - void checkPageB4Remove(Uint32, char *); - void checkIndexInLongKeyPage(Uint32, char *); + void checkPageArrayList(Signal* signal, const char *); + void checkPageB4Insert(Uint32, const char *); + void checkPageB4Remove(Uint32, const char *); + void checkIndexInLongKeyPage(Uint32, const char *); void printoutInfoAndShutdown(LongKeyPage *); void releaseLongPage(Signal* signal); void abortOperation(Signal* signal); diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index 79034c9eb36..2eba4deaf3e 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -4051,7 +4051,7 @@ void Dbacc::deleteLongKey(Signal* signal) }//Dbacc::deleteLongKey() -void Dbacc::checkIndexInLongKeyPage(Uint32 pageId, char *calledFrom) { +void Dbacc::checkIndexInLongKeyPage(Uint32 pageId, const char *calledFrom) { Page8Ptr pagePtr; LongKeyPage *page; Uint32 indexNo; @@ -4206,7 +4206,7 @@ void Dbacc::insertPageArrayList(Signal* signal) // --------------------------------------------------------------------------------- */ // Check the page array list. // --------------------------------------------------------------------------------- */ -void Dbacc::checkPageArrayList(Signal* signal, char *calledFrom) +void Dbacc::checkPageArrayList(Signal* signal, const char *calledFrom) { Page8Ptr pagePtr; Uint32 pageArrayIndex; @@ -4251,7 +4251,7 @@ void Dbacc::checkPageArrayList(Signal* signal, char *calledFrom) // --------------------------------------------------------------------------------- */ // Check the page to put into the pageArrayList. // --------------------------------------------------------------------------------- */ -void Dbacc::checkPageB4Insert(Uint32 pageId, char *calledFrom) { +void Dbacc::checkPageB4Insert(Uint32 pageId, const char *calledFrom) { Page8Ptr pagePtr; Uint32 pageArrayIndex; LongKeyPage *page; @@ -4318,7 +4318,7 @@ void Dbacc::checkPageB4Insert(Uint32 pageId, char *calledFrom) { // --------------------------------------------------------------------------------- */ // Check the page to remove from the pageArrayList. // --------------------------------------------------------------------------------- */ -void Dbacc::checkPageB4Remove(Uint32 pageId, char *calledFrom) { +void Dbacc::checkPageB4Remove(Uint32 pageId, const char *calledFrom) { Page8Ptr pagePtr; Uint32 pageArrayIndex; Uint32 noOfOccurrence = 0; diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 572e9f39ba5..bf9e02ead30 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -1638,7 +1638,7 @@ void Dbdih::execSTART_PERMREQ(Signal* signal) }//if if (getNodeStatus(nodeId) != NodeRecord::DEAD){ ndbout << "nodeStatus in START_PERMREQ = " - << getNodeStatus(nodeId) << endl; + << (Uint32) getNodeStatus(nodeId) << endl; ndbrequire(false); }//if @@ -4268,7 +4268,7 @@ void Dbdih::failedNodeLcpHandling(Signal* signal, NodeRecordPtr failedNodePtr) failedNodePtr.p->activeStatus = Sysfile::NS_NotActive_NotTakenOver; break; default: - ndbout << "activeStatus = " << failedNodePtr.p->activeStatus; + ndbout << "activeStatus = " << (Uint32) failedNodePtr.p->activeStatus; ndbout << " at failure after NODE_FAILREP of node = "; ndbout << failedNodePtr.i << endl; ndbrequire(false); @@ -6198,7 +6198,8 @@ void Dbdih::execCREATE_FRAGMENTATION_REQ(Signal * signal){ if (primaryTableId == RNIL) { if(fragmentNode == 0){ jam(); - NGPtr.i = c_nextNodeGroup; + // needs to be fixed for single fragment tables + NGPtr.i = 0; //c_nextNodeGroup; c_nextNodeGroup = (NGPtr.i + 1 == cnoOfNodeGroups ? 0 : NGPtr.i + 1); } else if(! (fragmentNode < MAX_NDB_NODES)) { jam(); @@ -6255,20 +6256,22 @@ void Dbdih::execCREATE_FRAGMENTATION_REQ(Signal * signal){ //@todo use section writer Uint32 count = 2; Uint32 fragments[2 + 8*MAX_REPLICAS*MAX_NDB_NODES]; + Uint32 next_replica_node[MAX_NDB_NODES]; + memset(next_replica_node,0,sizeof(next_replica_node)); if (primaryTableId == RNIL) { jam(); for(Uint32 fragNo = 0; fragNo<noOfFragments; fragNo++){ jam(); ptrCheckGuard(NGPtr, MAX_NDB_NODES, nodeGroupRecord); - Uint32 ind = NGPtr.p->nextReplicaNode; + Uint32 ind = next_replica_node[NGPtr.i]; const Uint32 max = NGPtr.p->nodeCount; //------------------------------------------------------------------- // We make an extra step to ensure that the primary replicas are // spread among the nodes. //------------------------------------------------------------------- - NGPtr.p->nextReplicaNode = (ind + 1 >= max ? 0 : ind + 1); + next_replica_node[NGPtr.i] = (ind + 1 >= max ? 0 : ind + 1); for(Uint32 replicaNo = 0; replicaNo<noOfReplicas; replicaNo++){ jam(); @@ -7127,7 +7130,7 @@ void Dbdih::checkGcpStopLab(Signal* signal) jam(); #ifdef VM_TRACE ndbout << "System crash due to GCP Stop in state = "; - ndbout << cgcpStatus << endl; + ndbout << (Uint32) cgcpStatus << endl; #endif crashSystemAtGcpStop(signal); return; @@ -7141,7 +7144,7 @@ void Dbdih::checkGcpStopLab(Signal* signal) jam(); #ifdef VM_TRACE ndbout << "System crash due to GCP Stop in state = "; - ndbout << cgcpStatus << endl; + ndbout << (Uint32) cgcpStatus << endl; #endif crashSystemAtGcpStop(signal); return; @@ -9074,7 +9077,7 @@ void Dbdih::checkTcCounterLab(Signal* signal) { CRASH_INSERTION(7009); if (c_lcpState.lcpStatus != LCP_STATUS_IDLE) { - ndbout << "lcpStatus = " << c_lcpState.lcpStatus; + ndbout << "lcpStatus = " << (Uint32) c_lcpState.lcpStatus; ndbout << "lcpStatusUpdatedPlace = " << c_lcpState.lcpStatusUpdatedPlace << endl; ndbrequire(false); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp b/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp index a50bb2fe52c..808cfd33696 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp @@ -353,11 +353,11 @@ operator<<(NdbOut& out, const Dbtup::Operationrec& op) out << " [interpretedExec " << dec << op.interpretedExec << "]"; out << " [opSimple " << dec << op.opSimple << "]"; // state - out << " [tupleState " << dec << op.tupleState << "]"; - out << " [transstate " << dec << op.transstate << "]"; + out << " [tupleState " << dec << (Uint32) op.tupleState << "]"; + out << " [transstate " << dec << (Uint32) op.transstate << "]"; out << " [inFragList " << dec << op.inFragList << "]"; out << " [inActiveOpList " << dec << op.inActiveOpList << "]"; - out << " [undoLogged " << dec << op.undoLogged << "]"; + out << " [undoLogged " << dec << (Uint32) op.undoLogged << "]"; // links out << " [prevActiveOp " << hex << op.prevActiveOp << "]"; out << " [nextActiveOp " << hex << op.nextActiveOp << "]"; diff --git a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp index 0061ebe812d..d880d3510c8 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp @@ -893,19 +893,19 @@ int Dbtup::handleReadReq(Signal* signal, if (regOperPtr->interpretedExec != 1) { jam(); - - Uint32 TnoOfDataRead = readAttributes(pagePtr, - Ttupheadoffset, - &cinBuffer[0], - regOperPtr->attrinbufLen, - dst, - dstLen, - false); - if (TnoOfDataRead != (Uint32)-1) { + int ret = readAttributes(pagePtr, + Ttupheadoffset, + &cinBuffer[0], + regOperPtr->attrinbufLen, + dst, + dstLen, + false); + if (ret != -1) { /* ------------------------------------------------------------------------- */ // We have read all data into coutBuffer. Now send it to the API. /* ------------------------------------------------------------------------- */ jam(); + Uint32 TnoOfDataRead= (Uint32) ret; regOperPtr->attroutbufLen = TnoOfDataRead; sendReadAttrinfo(signal, TnoOfDataRead, regOperPtr); return 0; @@ -1111,7 +1111,7 @@ Dbtup::updateStartLab(Signal* signal, regOperPtr->pageOffset, &cinBuffer[0], regOperPtr->attrinbufLen); - if (retValue == (Uint32)-1) { + if (retValue == -1) { tupkeyErrorLab(signal); }//if } else { @@ -1215,7 +1215,7 @@ int Dbtup::interpreterStartLab(Signal* signal, { Operationrec * const regOperPtr = operPtr.p; Uint32 RtotalLen; - Uint32 TnoDataRW; + int TnoDataRW; Uint32 RinitReadLen = cinBuffer[0]; Uint32 RexecRegionLen = cinBuffer[1]; @@ -1273,7 +1273,7 @@ int Dbtup::interpreterStartLab(Signal* signal, &dst[0], dstLen, false); - if (TnoDataRW != (Uint32)-1) { + if (TnoDataRW != -1) { RattroutCounter = TnoDataRW; RinstructionCounter += RinitReadLen; } else { @@ -1300,7 +1300,7 @@ int Dbtup::interpreterStartLab(Signal* signal, RsubLen, &coutBuffer[0], sizeof(coutBuffer) / 4); - if (TnoDataRW != (Uint32)-1) { + if (TnoDataRW != -1) { RinstructionCounter += RexecRegionLen; RlogSize = TnoDataRW; } else { @@ -1319,7 +1319,7 @@ int Dbtup::interpreterStartLab(Signal* signal, TupHeadOffset, &cinBuffer[RinstructionCounter], RfinalUpdateLen); - if (TnoDataRW != (Uint32)-1) { + if (TnoDataRW != -1) { MEMCOPY_NO_WORDS(&clogMemBuffer[RlogSize], &cinBuffer[RinstructionCounter], RfinalUpdateLen); @@ -1347,7 +1347,7 @@ int Dbtup::interpreterStartLab(Signal* signal, &dst[RattroutCounter], (dstLen - RattroutCounter), false); - if (TnoDataRW != (Uint32)-1) { + if (TnoDataRW != -1) { RattroutCounter += TnoDataRW; } else { jam(); @@ -1480,14 +1480,13 @@ int Dbtup::interpreterNextLab(Signal* signal, /* ---------------------------------------------------------------- */ { Uint32 theAttrinfo = theInstruction; - Uint32 TnoDataRW; - TnoDataRW = readAttributes(pagePtr, - TupHeadOffset, - &theAttrinfo, - (Uint32)1, - &TregMemBuffer[theRegister], - (Uint32)3, - false); + int TnoDataRW= readAttributes(pagePtr, + TupHeadOffset, + &theAttrinfo, + (Uint32)1, + &TregMemBuffer[theRegister], + (Uint32)3, + false); if (TnoDataRW == 2) { /* ------------------------------------------------------------- */ // Two words read means that we get the instruction plus one 32 @@ -1511,7 +1510,7 @@ int Dbtup::interpreterNextLab(Signal* signal, TregMemBuffer[theRegister] = 0; TregMemBuffer[theRegister + 2] = 0; TregMemBuffer[theRegister + 3] = 0; - } else if (TnoDataRW == (Uint32)-1) { + } else if (TnoDataRW == -1) { jam(); tupkeyErrorLab(signal); return -1; @@ -1564,12 +1563,11 @@ int Dbtup::interpreterNextLab(Signal* signal, ah.setNULL(); Tlen = 1; }//if - Uint32 TnoDataRW; - TnoDataRW = updateAttributes(pagePtr, - TupHeadOffset, - &TdataForUpdate[0], - Tlen); - if (TnoDataRW != (Uint32)-1) { + int TnoDataRW= updateAttributes(pagePtr, + TupHeadOffset, + &TdataForUpdate[0], + Tlen); + if (TnoDataRW != -1) { /* --------------------------------------------------------- */ // Write the written data also into the log buffer so that it // will be logged. diff --git a/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp b/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp index 2dd707ebafc..be0d86b3f3d 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp @@ -166,7 +166,7 @@ Dbtup::tuxReadAttrs(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tu fragptr = fragptr_old; operPtr = operPtr_old; // done - if (ret == (Uint32)-1) { + if (ret == -1) { ret = terrorCode ? (-(int)terrorCode) : -1; } return ret; @@ -206,7 +206,7 @@ Dbtup::tuxReadPk(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* data fragptr = fragptr_old; operPtr = operPtr_old; // done - if (ret != (Uint32)-1) { + if (ret != -1) { // remove headers Uint32 n = 0; Uint32 i = 0; diff --git a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp index a4e7cb47249..e6cc6f68842 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp @@ -156,12 +156,12 @@ Dbtup::setUpQueryRoutines(Tablerec* const regTabPtr) // tabptr.p Table record pointer /* ---------------------------------------------------------------- */ int Dbtup::readAttributes(Page* const pagePtr, - Uint32 tupHeadOffset, - const Uint32* inBuffer, - Uint32 inBufLen, - Uint32* outBuffer, - Uint32 maxRead, - bool xfrmFlag) + Uint32 tupHeadOffset, + const Uint32* inBuffer, + Uint32 inBufLen, + Uint32* outBuffer, + Uint32 maxRead, + bool xfrmFlag) { Tablerec* const regTabPtr = tabptr.p; Uint32 numAttributes = regTabPtr->noOfAttr; @@ -198,7 +198,7 @@ int Dbtup::readAttributes(Page* const pagePtr, attributeOffset)) { continue; } else { - return (Uint32)-1; + return -1; }//if } else if(attributeId & AttributeHeader::PSUEDO){ Uint32 sz = read_psuedo(attributeId, @@ -207,7 +207,7 @@ int Dbtup::readAttributes(Page* const pagePtr, tOutBufIndex = tmpAttrBufIndex + 1 + sz; } else { terrorCode = ZATTRIBUTE_ID_ERROR; - return (Uint32)-1; + return -1; }//if }//while return tOutBufIndex; @@ -256,11 +256,11 @@ int Dbtup::readAttributesWithoutHeader(Page* const pagePtr, attributeOffset)) { continue; } else { - return (Uint32)-1; + return -1; }//if } else { terrorCode = ZATTRIBUTE_ID_ERROR; - return (Uint32)-1; + return -1; }//if }//while ndbrequire(attrBufIndex == inBufLen); @@ -678,12 +678,12 @@ int Dbtup::updateAttributes(Page* const pagePtr, continue; } else { ljam(); - return (Uint32)-1; + return -1; }//if } else { ljam(); terrorCode = ZATTRIBUTE_ID_ERROR; - return (Uint32)-1; + return -1; }//if }//while return 0; diff --git a/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp b/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp index c0b49364ee6..0a961903340 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp @@ -746,14 +746,15 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, //-------------------------------------------------------------------- // Read Primary Key Values //-------------------------------------------------------------------- - noPrimKey = readAttributes(pagep.p, - tupheadoffset, - &tableDescriptor[regTabPtr->readKeyArray].tabDescr, - regTabPtr->noOfKeyAttr, - keyBuffer, - ZATTR_BUFFER_SIZE, - true); - ndbrequire(noPrimKey != (Uint32)-1); + int ret= readAttributes(pagep.p, + tupheadoffset, + &tableDescriptor[regTabPtr->readKeyArray].tabDescr, + regTabPtr->noOfKeyAttr, + keyBuffer, + ZATTR_BUFFER_SIZE, + true); + ndbrequire(ret != -1); + noPrimKey= ret; Uint32 numAttrsToRead; if ((regOperPtr->optype == ZUPDATE) && @@ -788,14 +789,15 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, if ((regOperPtr->optype != ZDELETE) || (trigPtr->sendBeforeValues)) { ljam(); - noMainWords = readAttributes(pagep.p, - tupheadoffset, - &readBuffer[0], - numAttrsToRead, - mainBuffer, - ZATTR_BUFFER_SIZE, - true); - ndbrequire(noMainWords != (Uint32)-1); + int ret= readAttributes(pagep.p, + tupheadoffset, + &readBuffer[0], + numAttrsToRead, + mainBuffer, + ZATTR_BUFFER_SIZE, + true); + ndbrequire(ret != -1); + noMainWords= ret; } else { ljam(); noMainWords = 0; @@ -813,15 +815,16 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, pagep.i = regOperPtr->realPageIdC; ptrCheckGuard(pagep, cnoOfPage, page); - noCopyWords = readAttributes(pagep.p, - tupheadoffset, - &readBuffer[0], - numAttrsToRead, - copyBuffer, - ZATTR_BUFFER_SIZE, - true); + int ret= readAttributes(pagep.p, + tupheadoffset, + &readBuffer[0], + numAttrsToRead, + copyBuffer, + ZATTR_BUFFER_SIZE, + true); - ndbrequire(noCopyWords != (Uint32)-1); + ndbrequire(ret != -1); + noCopyWords = ret; if ((noMainWords == noCopyWords) && (memcmp(mainBuffer, copyBuffer, noMainWords << 2) == 0)) { //-------------------------------------------------------------------- diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp index 1069cf93b06..97f8c8cda1b 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp @@ -38,9 +38,9 @@ void Ndbcntr::initRecords() Ndbcntr::Ndbcntr(const class Configuration & conf): SimulatedBlock(NDBCNTR, conf), c_stopRec(* this), - c_missra(* this), cnoWaitrep6(0), - cnoWaitrep7(0) + cnoWaitrep7(0), + c_missra(* this) { BLOCK_CONSTRUCTOR(Ndbcntr); diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index b03a4f8a419..1258f86ccc4 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -828,6 +828,8 @@ CommandInterpreter::executeShow(char* parameters) case NDB_MGM_NODE_TYPE_UNKNOWN: ndbout << "Error: Unknown Node Type" << endl; return; + case NDB_MGM_NODE_TYPE_REP: + abort(); } } @@ -1638,7 +1640,7 @@ CommandInterpreter::executeStartBackup(char* /*parameters*/) if(tmp) { ndbout << tmp; - int id; + unsigned int id; if(sscanf(tmp, "%*[^:]: Backup %d ", &id) == 1 && id == backupId){ count++; } diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 2c2aeda21ed..2a054a01f1e 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -647,6 +647,7 @@ versionCallback(int nodeId, int version, void * anyData, int errCode){ } break; case NDB_MGM_NODE_TYPE_UNKNOWN: + case NDB_MGM_NODE_TYPE_REP: abort(); }; diff --git a/ndb/src/mgmsrv/Config.cpp b/ndb/src/mgmsrv/Config.cpp index b8a494cb759..f9c6a23f909 100644 --- a/ndb/src/mgmsrv/Config.cpp +++ b/ndb/src/mgmsrv/Config.cpp @@ -85,6 +85,9 @@ Config::printAllNameValuePairs(NdbOut &out, MGM_REQUIRE(prop->get(n, &str_value)); out << str_value; break; + case ConfigInfo::SECTION: + out << "SECTION"; + break; } out << endl; } diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index bff7f9be0e6..22338b1a801 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -3559,7 +3559,7 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>§ions, { unsigned c= 0; p_db_hosts.get(str.c_str(),&c); - if (c+1 == (1 << (replicas-1))) // all nodes on same machine + if (c+1 == (1u << (replicas-1))) // all nodes on same machine node_group_warning.append(".\n Host failure will " "cause complete cluster shutdown."); else if (c > 0) diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index 652e0f96190..008a9d0551f 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -42,7 +42,7 @@ InitConfigFileParser::~InitConfigFileParser() { // Read Config File //**************************************************************************** InitConfigFileParser::Context::Context(const ConfigInfo * info) - : m_configValues(1000, 20), m_userProperties(true) { + : m_userProperties(true), m_configValues(1000, 20) { m_config = new Properties(true); m_defaults = new Properties(true); @@ -349,6 +349,8 @@ InitConfigFileParser::storeNameValuePair(Context& ctx, case ConfigInfo::STRING: MGM_REQUIRE(ctx.m_currentSection->put(pname, value)); break; + case ConfigInfo::SECTION: + abort(); } return true; } diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 5242237a638..9c32facef3e 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -1252,8 +1252,9 @@ MgmStatService::log(int eventType, const Uint32* theData, NodeId nodeId){ Uint32 threshold = 0; LogLevel::EventCategory cat; - - for(unsigned i = 0; i<EventLogger::matrixSize; i++){ + int i; + + for(i = 0; (unsigned)i<EventLogger::matrixSize; i++){ if(EventLogger::matrix[i].eventType == eventType){ cat = EventLogger::matrix[i].eventCategory; threshold = EventLogger::matrix[i].threshold; @@ -1266,7 +1267,6 @@ MgmStatService::log(int eventType, const Uint32* theData, NodeId nodeId){ Vector<NDB_SOCKET_TYPE> copy; m_clients.lock(); - int i; for(i = m_clients.size() - 1; i >= 0; i--){ if(threshold <= m_clients[i].m_logLevel.getLogLevel(cat)){ if(m_clients[i].m_socket >= 0 && @@ -1279,14 +1279,14 @@ MgmStatService::log(int eventType, const Uint32* theData, NodeId nodeId){ } m_clients.unlock(); - for(i = 0; (unsigned)i<copy.size(); i++){ + for(i = 0; (unsigned)i < copy.size(); i++){ NDB_CLOSE_SOCKET(copy[i]); } if(copy.size()){ LogLevel tmp; tmp.clear(); m_clients.lock(); - for(i = 0; i < m_clients.size(); i++){ + for(i = 0; (unsigned)i < m_clients.size(); i++){ tmp.set_max(m_clients[i].m_logLevel); } m_clients.unlock(); diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index 6172e7076eb..feab95d8ca5 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -1440,11 +1440,11 @@ NdbOut& operator<<(NdbOut& out, const NdbBlob& blob) { ndbout << dec << "o=" << blob.getOperationType(); - ndbout << dec << " s=" << blob.theState; + ndbout << dec << " s=" << (Uint32) blob.theState; ndbout << dec << " n=" << blob.theNullFlag;; ndbout << dec << " l=" << blob.theLength; ndbout << dec << " p=" << blob.thePos; - ndbout << dec << " u=" << blob.theHeadInlineUpdateFlag; + ndbout << dec << " u=" << (Uint32) blob.theHeadInlineUpdateFlag; return out; } #endif diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp index da2d34e270a..27dbc19eb6b 100644 --- a/ndb/src/ndbapi/NdbConnection.cpp +++ b/ndb/src/ndbapi/NdbConnection.cpp @@ -730,7 +730,8 @@ NdbConnection::doSend() theNdb->insert_completed_list(this); DBUG_RETURN(0); default: - ndbout << "Inconsistent theSendStatus = " << theSendStatus << endl; + ndbout << "Inconsistent theSendStatus = " + << (Uint32) theSendStatus << endl; abort(); break; }//switch @@ -1643,6 +1644,10 @@ NdbConnection::receiveTCKEY_FAILCONF(const TcKeyFailConf * failConf) setOperationErrorCodeAbort(4115); tOp = NULL; break; + case NdbOperation::NotDefined: + case NdbOperation::NotDefined2: + assert(); + break; }//if }//while theReleaseOnClose = true; @@ -1924,14 +1929,14 @@ NdbConnection::printState() CASE(Connected); CASE(DisConnecting); CASE(ConnectFailure); - default: ndbout << theStatus; + default: ndbout << (Uint32) theStatus; } switch (theListState) { CASE(NotInList); CASE(InPreparedList); CASE(InSendList); CASE(InCompletedList); - default: ndbout << theListState; + default: ndbout << (Uint32) theListState; } switch (theSendStatus) { CASE(NotInit); @@ -1944,7 +1949,7 @@ NdbConnection::printState() CASE(sendTC_ROLLBACK); CASE(sendTC_COMMIT); CASE(sendTC_OP); - default: ndbout << theSendStatus; + default: ndbout << (Uint32) theSendStatus; } switch (theCommitStatus) { CASE(NotStarted); @@ -1952,14 +1957,14 @@ NdbConnection::printState() CASE(Committed); CASE(Aborted); CASE(NeedAbort); - default: ndbout << theCommitStatus; + default: ndbout << (Uint32) theCommitStatus; } switch (theCompletionStatus) { CASE(NotCompleted); CASE(CompletedSuccess); CASE(CompletedFailure); CASE(DefinitionFailure); - default: ndbout << theCompletionStatus; + default: ndbout << (Uint32) theCompletionStatus; } ndbout << endl; } diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 5e640cdebd5..4d33060497d 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -148,6 +148,9 @@ NdbColumnImpl::init(Type t) m_length = 4; m_cs = default_cs; break; + case Undefined: + assert(); + break; } m_pk = false; m_nullable = false; diff --git a/ndb/src/ndbapi/NdbReceiver.cpp b/ndb/src/ndbapi/NdbReceiver.cpp index 3a1ea9c10d1..14f8d4b8440 100644 --- a/ndb/src/ndbapi/NdbReceiver.cpp +++ b/ndb/src/ndbapi/NdbReceiver.cpp @@ -92,7 +92,7 @@ NdbReceiver::getValue(const NdbColumnImpl* tAttrInfo, char * user_dst_ptr){ return 0; } -#define KEY_ATTR_ID (~0) +#define KEY_ATTR_ID (~(Uint32)0) void NdbReceiver::calculate_batch_size(Uint32 key_size, diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp index df218e00fbc..a5f2a4801d5 100644 --- a/ndb/src/ndbapi/Ndblist.cpp +++ b/ndb/src/ndbapi/Ndblist.cpp @@ -33,7 +33,7 @@ Ndb::checkFailedNode() DBUG_PRINT("enter", ("theNoOfDBnodes: %d", theNoOfDBnodes)); DBUG_ASSERT(theNoOfDBnodes < MAX_NDB_NODES); - for (int i = 0; i < theNoOfDBnodes; i++){ + for (Uint32 i = 0; i < theNoOfDBnodes; i++){ const NodeId node_id = theDBnodes[i]; DBUG_PRINT("info", ("i: %d, node_id: %d", i, node_id));