Loading mysql-test/t/ndb_autodiscover2.test +1 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ # The previous step has simply removed the frm file # from disk, but left the table in NDB # --sleep 3; select * from t9 order by a; # handler_discover should be zero Loading ndb/src/ndbapi/Ndb.cpp +42 −26 Original line number Diff line number Diff line Loading @@ -246,6 +246,7 @@ Ndb::waitUntilReady(int timeout) int secondsCounter = 0; int milliCounter = 0; int noChecksSinceFirstAliveFound = 0; int id; if (theInitState != Initialised) { // Ndb::init is not called Loading @@ -254,6 +255,7 @@ Ndb::waitUntilReady(int timeout) } do { if ((id = theNode) != 0) { unsigned int foundAliveNode = 0; TransporterFacade *tp = TransporterFacade::instance(); tp->lock_mutex(); Loading @@ -277,16 +279,24 @@ Ndb::waitUntilReady(int timeout) if (noChecksSinceFirstAliveFound > 30) { DBUG_RETURN(0); }//if }//if theNode != 0 if (secondsCounter >= timeout) break; NdbSleep_MilliSleep(100); milliCounter += 100; if (milliCounter >= 1000) { secondsCounter++; milliCounter = 0; }//if } while ( secondsCounter < timeout ); } while (1); if (id == 0) { theError.code = 4269; DBUG_RETURN(-1); } if (noChecksSinceFirstAliveFound > 0) { DBUG_RETURN(0); }//if theError.code = 4009; DBUG_RETURN(-1); } Loading Loading @@ -789,8 +799,10 @@ Ndb::readAutoIncrementValue(const char* aTableName) { DEBUG_TRACE("readtAutoIncrementValue"); const NdbTableImpl* table = theDictionary->getTable(aTableName); if (table == 0) if (table == 0) { theError= theDictionary->getNdbError(); return ~0; } Uint64 tupleId = readTupleIdFromNdb(table->m_tableId); return tupleId; } Loading Loading @@ -821,8 +833,10 @@ Ndb::setAutoIncrementValue(const char* aTableName, Uint64 val, bool increase) { DEBUG_TRACE("setAutoIncrementValue " << val); const NdbTableImpl* table = theDictionary->getTable(aTableName); if (table == 0) if (table == 0) { theError= theDictionary->getNdbError(); return false; } return setTupleIdInNdb(table->m_tableId, val, increase); } Loading @@ -841,8 +855,10 @@ Ndb::setTupleIdInNdb(const char* aTableName, Uint64 val, bool increase ) { DEBUG_TRACE("setTupleIdInNdb"); const NdbTableImpl* table = theDictionary->getTable(aTableName); if (table == 0) if (table == 0) { theError= theDictionary->getNdbError(); return false; } return setTupleIdInNdb(table->m_tableId, val, increase); } Loading ndb/src/ndbapi/NdbDictionaryImpl.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -1500,8 +1500,11 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, if (!alter && haveAutoIncrement) { // if (!ndb.setAutoIncrementValue(impl.m_internalName.c_str(), autoIncrementValue)) { if (!ndb.setAutoIncrementValue(impl.m_externalName.c_str(), autoIncrementValue)) { if (ndb.theError.code == 0) { m_error.code = 4336; ndb.theError = m_error; } else m_error= ndb.theError; ret = -1; // errorcode set in initialize_autoincrement } } Loading ndb/src/ndbapi/Ndbif.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -185,10 +185,10 @@ Ndb::executeMessage(void* NdbObject, void Ndb::connected(Uint32 ref) { theMyRef= ref; theNode= refToNode(ref); Uint32 tmpTheNode= refToNode(ref); Uint64 tBlockNo= refToBlock(ref); if (theNdbBlockNumber >= 0){ assert(theMyRef == numberToRef(theNdbBlockNumber, theNode)); assert(theMyRef == numberToRef(theNdbBlockNumber, tmpTheNode)); } TransporterFacade * theFacade = TransporterFacade::instance(); Loading @@ -201,18 +201,19 @@ void Ndb::connected(Uint32 ref) } } theFirstTransId = ((Uint64)tBlockNo << 52)+ ((Uint64)theNode << 40); ((Uint64)tmpTheNode << 40); theFirstTransId += theFacade->m_max_trans_id; // assert(0); DBUG_PRINT("info",("connected with ref=%x, id=%d, no_db_nodes=%d, first_trans_id=%lx", theMyRef, theNode, tmpTheNode, theNoOfDBnodes, theFirstTransId)); startTransactionNodeSelectionData.init(theNoOfDBnodes, theDBnodes); theCommitAckSignal = new NdbApiSignal(theMyRef); theDictionary->m_receiver.m_reference= theMyRef; theNode= tmpTheNode; // flag that Ndb object is initialized } void Loading ndb/src/ndbapi/Ndbinit.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theNode= 0; theFirstTransId= 0; theMyRef= 0; theNoOfDBnodes= 0; fullyQualifiedNames = true; Loading Loading
mysql-test/t/ndb_autodiscover2.test +1 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ # The previous step has simply removed the frm file # from disk, but left the table in NDB # --sleep 3; select * from t9 order by a; # handler_discover should be zero Loading
ndb/src/ndbapi/Ndb.cpp +42 −26 Original line number Diff line number Diff line Loading @@ -246,6 +246,7 @@ Ndb::waitUntilReady(int timeout) int secondsCounter = 0; int milliCounter = 0; int noChecksSinceFirstAliveFound = 0; int id; if (theInitState != Initialised) { // Ndb::init is not called Loading @@ -254,6 +255,7 @@ Ndb::waitUntilReady(int timeout) } do { if ((id = theNode) != 0) { unsigned int foundAliveNode = 0; TransporterFacade *tp = TransporterFacade::instance(); tp->lock_mutex(); Loading @@ -277,16 +279,24 @@ Ndb::waitUntilReady(int timeout) if (noChecksSinceFirstAliveFound > 30) { DBUG_RETURN(0); }//if }//if theNode != 0 if (secondsCounter >= timeout) break; NdbSleep_MilliSleep(100); milliCounter += 100; if (milliCounter >= 1000) { secondsCounter++; milliCounter = 0; }//if } while ( secondsCounter < timeout ); } while (1); if (id == 0) { theError.code = 4269; DBUG_RETURN(-1); } if (noChecksSinceFirstAliveFound > 0) { DBUG_RETURN(0); }//if theError.code = 4009; DBUG_RETURN(-1); } Loading Loading @@ -789,8 +799,10 @@ Ndb::readAutoIncrementValue(const char* aTableName) { DEBUG_TRACE("readtAutoIncrementValue"); const NdbTableImpl* table = theDictionary->getTable(aTableName); if (table == 0) if (table == 0) { theError= theDictionary->getNdbError(); return ~0; } Uint64 tupleId = readTupleIdFromNdb(table->m_tableId); return tupleId; } Loading Loading @@ -821,8 +833,10 @@ Ndb::setAutoIncrementValue(const char* aTableName, Uint64 val, bool increase) { DEBUG_TRACE("setAutoIncrementValue " << val); const NdbTableImpl* table = theDictionary->getTable(aTableName); if (table == 0) if (table == 0) { theError= theDictionary->getNdbError(); return false; } return setTupleIdInNdb(table->m_tableId, val, increase); } Loading @@ -841,8 +855,10 @@ Ndb::setTupleIdInNdb(const char* aTableName, Uint64 val, bool increase ) { DEBUG_TRACE("setTupleIdInNdb"); const NdbTableImpl* table = theDictionary->getTable(aTableName); if (table == 0) if (table == 0) { theError= theDictionary->getNdbError(); return false; } return setTupleIdInNdb(table->m_tableId, val, increase); } Loading
ndb/src/ndbapi/NdbDictionaryImpl.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -1500,8 +1500,11 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, if (!alter && haveAutoIncrement) { // if (!ndb.setAutoIncrementValue(impl.m_internalName.c_str(), autoIncrementValue)) { if (!ndb.setAutoIncrementValue(impl.m_externalName.c_str(), autoIncrementValue)) { if (ndb.theError.code == 0) { m_error.code = 4336; ndb.theError = m_error; } else m_error= ndb.theError; ret = -1; // errorcode set in initialize_autoincrement } } Loading
ndb/src/ndbapi/Ndbif.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -185,10 +185,10 @@ Ndb::executeMessage(void* NdbObject, void Ndb::connected(Uint32 ref) { theMyRef= ref; theNode= refToNode(ref); Uint32 tmpTheNode= refToNode(ref); Uint64 tBlockNo= refToBlock(ref); if (theNdbBlockNumber >= 0){ assert(theMyRef == numberToRef(theNdbBlockNumber, theNode)); assert(theMyRef == numberToRef(theNdbBlockNumber, tmpTheNode)); } TransporterFacade * theFacade = TransporterFacade::instance(); Loading @@ -201,18 +201,19 @@ void Ndb::connected(Uint32 ref) } } theFirstTransId = ((Uint64)tBlockNo << 52)+ ((Uint64)theNode << 40); ((Uint64)tmpTheNode << 40); theFirstTransId += theFacade->m_max_trans_id; // assert(0); DBUG_PRINT("info",("connected with ref=%x, id=%d, no_db_nodes=%d, first_trans_id=%lx", theMyRef, theNode, tmpTheNode, theNoOfDBnodes, theFirstTransId)); startTransactionNodeSelectionData.init(theNoOfDBnodes, theDBnodes); theCommitAckSignal = new NdbApiSignal(theMyRef); theDictionary->m_receiver.m_reference= theMyRef; theNode= tmpTheNode; // flag that Ndb object is initialized } void Loading
ndb/src/ndbapi/Ndbinit.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theNode= 0; theFirstTransId= 0; theMyRef= 0; theNoOfDBnodes= 0; fullyQualifiedNames = true; Loading