diff --git a/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index 249a0177b3f..84e3279afaf 100644 --- a/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -2316,7 +2316,33 @@ Ndbcntr::StopRecord::checkNodeFail(Signal* signal){ { NdbNodeBitmask tmp; tmp.assign(NdbNodeBitmask::Size, stopReq.nodes); + + NdbNodeBitmask ndbStopNodes; + ndbStopNodes.assign(NdbNodeBitmask::Size, stopReq.nodes); + ndbStopNodes.bitAND(ndbMask); + ndbStopNodes.copyto(NdbNodeBitmask::Size, stopReq.nodes); + ndbMask.bitANDC(tmp); + + bool allNodesStopped = true; + int i ; + for( i = 0; i< NdbNodeBitmask::Size; i++ ){ + if ( stopReq.nodes[i] != 0 ){ + allNodesStopped = false; + break; + } + } + + if ( allNodesStopped ) { + StopConf * const stopConf = (StopConf *)&signal->theData[0]; + stopConf->senderData = stopReq.senderData; + stopConf->nodeState = (Uint32) NodeState::SL_NOTHING; + cntr.sendSignal(stopReq.senderRef, GSN_STOP_CONF, signal, + StopConf::SignalLength, JBB); + stopReq.senderRef = 0; + return false; + } + } else { diff --git a/storage/ndb/src/mgmclient/CommandInterpreter.cpp b/storage/ndb/src/mgmclient/CommandInterpreter.cpp index afb047d8283..8bff874a97a 100644 --- a/storage/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/storage/ndb/src/mgmclient/CommandInterpreter.cpp @@ -1031,7 +1031,7 @@ CommandInterpreter::execute_impl(const char *_line, bool interactive) int node_id; if (convert(command_list[pos].c_str(), node_id)) { - if (node_id <= 0) { + if (node_id <= 0 || node_id > MAX_NODES) { ndbout << "Invalid node ID: " << command_list[pos].c_str() << "." << endl; DBUG_RETURN(true); diff --git a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp index e85cc2e4cd8..222b71dbaac 100644 --- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -1009,6 +1009,11 @@ int MgmtSrvr::sendSTOP_REQ(const Vector &node_ids, { nodeId= node_ids[i]; ndbout << "asked to stop " << nodeId << endl; + + if ((getNodeType(nodeId) != NDB_MGM_NODE_TYPE_MGM) + &&(getNodeType(nodeId) != NDB_MGM_NODE_TYPE_NDB)) + return WRONG_PROCESS_TYPE; + if (getNodeType(nodeId) != NDB_MGM_NODE_TYPE_MGM) nodes_to_stop.set(nodeId); else if (nodeId != getOwnNodeId())