diff options
author | unknown <mskold@mysql.com> | 2005-02-11 22:30:37 +0100 |
---|---|---|
committer | unknown <mskold@mysql.com> | 2005-02-11 22:30:37 +0100 |
commit | 810d558f97ea42ec5f67d5559e975f3d41730a09 (patch) | |
tree | 5327def971aba5514d2e7523671b429ff151d7b7 /ndb/src/ndbapi | |
parent | 7185c070d0848a0a39ad22f6bd24cd5d9915e0c2 (diff) | |
parent | 9387349ed27367a5f88dcae4f4175791dcccb1ff (diff) | |
download | mariadb-git-810d558f97ea42ec5f67d5559e975f3d41730a09.tar.gz |
Merge
sql/filesort.cc:
Auto merged
sql/ha_ndbcluster.h:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_select.cc:
Auto merged
Diffstat (limited to 'ndb/src/ndbapi')
-rw-r--r-- | ndb/src/ndbapi/ClusterMgr.cpp | 4 | ||||
-rw-r--r-- | ndb/src/ndbapi/Ndb.cpp | 31 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbDictionaryImpl.cpp | 54 | ||||
-rw-r--r-- | ndb/src/ndbapi/Ndbif.cpp | 32 | ||||
-rw-r--r-- | ndb/src/ndbapi/TransporterFacade.cpp | 10 | ||||
-rw-r--r-- | ndb/src/ndbapi/ndb_cluster_connection.cpp | 5 |
6 files changed, 73 insertions, 63 deletions
diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp index ef6e35e0702..41ae532164b 100644 --- a/ndb/src/ndbapi/ClusterMgr.cpp +++ b/ndb/src/ndbapi/ClusterMgr.cpp @@ -54,7 +54,6 @@ runClusterMgr_C(void * me) #ifdef NDB_OSE NdbSleep_MilliSleep(50); #endif - NdbThread_Exit(0); return NULL; } @@ -563,10 +562,7 @@ extern "C" void* runArbitMgr_C(void* me) { - my_thread_init(); ((ArbitMgr*) me)->threadMain(); - my_thread_end(); - NdbThread_Exit(0); return NULL; } diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index e7b36d6ee02..59d1e45ca46 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -49,13 +49,15 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode) Uint32 tAnyAlive = 0; int TretCode= 0; + DBUG_ENTER("Ndb::doConnect"); + if (tConNode != 0) { TretCode = NDB_connect(tConNode); if ((TretCode == 1) || (TretCode == 2)) { //**************************************************************************** // We have connections now to the desired node. Return //**************************************************************************** - return getConnectedNdbTransaction(tConNode); + DBUG_RETURN(getConnectedNdbTransaction(tConNode)); } else if (TretCode != 0) { tAnyAlive = 1; }//if @@ -78,10 +80,11 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode) //**************************************************************************** // We have connections now to the desired node. Return //**************************************************************************** - return getConnectedNdbTransaction(tNode); + DBUG_RETURN(getConnectedNdbTransaction(tNode)); } else if (TretCode != 0) { tAnyAlive= 1; }//if + DBUG_PRINT("info",("tried node %d TretCode %d", tNode, TretCode)); } } else // just do a regular round robin @@ -103,10 +106,11 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode) //**************************************************************************** // We have connections now to the desired node. Return //**************************************************************************** - return getConnectedNdbTransaction(tNode); + DBUG_RETURN(getConnectedNdbTransaction(tNode)); } else if (TretCode != 0) { tAnyAlive= 1; }//if + DBUG_PRINT("info",("tried node %d TretCode %d", tNode, TretCode)); } while (Tcount < tNoOfDbNodes); } //**************************************************************************** @@ -121,7 +125,7 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode) } else { theError.code = 4009; }//if - return NULL; + DBUG_RETURN(NULL); } int @@ -134,29 +138,31 @@ Ndb::NDB_connect(Uint32 tNode) int tReturnCode; TransporterFacade *tp = TransporterFacade::instance(); + DBUG_ENTER("Ndb::NDB_connect"); + bool nodeAvail = tp->get_node_alive(tNode); if(nodeAvail == false){ - return 0; + DBUG_RETURN(0); } NdbTransaction * tConArray = theConnectionArray[tNode]; if (tConArray != NULL) { - return 2; + DBUG_RETURN(2); } NdbTransaction * tNdbCon = getNdbCon(); // Get free connection object. if (tNdbCon == NULL) { - return 4; + DBUG_RETURN(4); }//if NdbApiSignal* tSignal = getSignal(); // Get signal object if (tSignal == NULL) { releaseNdbCon(tNdbCon); - return 4; + DBUG_RETURN(4); }//if if (tSignal->setSignal(GSN_TCSEIZEREQ) == -1) { releaseNdbCon(tNdbCon); releaseSignal(tSignal); - return 4; + DBUG_RETURN(4); }//if tSignal->setData(tNdbCon->ptr2int(), 1); //************************************************ @@ -192,13 +198,16 @@ Ndb::NDB_connect(Uint32 tNode) tNdbCon->setMyBlockReference(theMyRef); theConnectionArray[tNode] = tNdbCon; tNdbCon->theNext = tPrevFirst; - return 1; + DBUG_RETURN(1); } else { releaseNdbCon(tNdbCon); //**************************************************************************** // Unsuccessful connect is indicated by 3. //**************************************************************************** - return 3; + DBUG_PRINT("info", + ("unsuccessful connect tReturnCode %d, tNdbCon->Status() %d", + tReturnCode, tNdbCon->Status())); + DBUG_RETURN(3); }//if }//Ndb::NDB_connect() diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index a089a818fb5..05c635ec005 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -192,37 +192,38 @@ NdbColumnImpl::~NdbColumnImpl() bool NdbColumnImpl::equal(const NdbColumnImpl& col) const { + DBUG_ENTER("NdbColumnImpl::equal"); if(strcmp(m_name.c_str(), col.m_name.c_str()) != 0){ - return false; + DBUG_RETURN(false); } if(m_type != col.m_type){ - return false; + DBUG_RETURN(false); } if(m_pk != col.m_pk){ - return false; + DBUG_RETURN(false); } if(m_nullable != col.m_nullable){ - return false; + DBUG_RETURN(false); } if(m_pk){ if(m_distributionKey != col.m_distributionKey){ - return false; + DBUG_RETURN(false); } } if (m_precision != col.m_precision || m_scale != col.m_scale || m_length != col.m_length || m_cs != col.m_cs) { - return false; + DBUG_RETURN(false); } if (m_autoIncrement != col.m_autoIncrement){ - return false; + DBUG_RETURN(false); } if(strcmp(m_defaultValue.c_str(), col.m_defaultValue.c_str()) != 0){ - return false; + DBUG_RETURN(false); } - return true; + DBUG_RETURN(true); } NdbDictionary::Column * @@ -295,7 +296,7 @@ void NdbTableImpl::init(){ clearNewProperties(); m_frm.clear(); - m_fragmentType = NdbDictionary::Object::FragAllMedium; + m_fragmentType = NdbDictionary::Object::FragAllSmall; m_logging = true; m_kvalue = 6; m_minLoadFactor = 78; @@ -314,49 +315,62 @@ NdbTableImpl::init(){ bool NdbTableImpl::equal(const NdbTableImpl& obj) const { + DBUG_ENTER("NdbTableImpl::equal"); if ((m_internalName.c_str() == NULL) || (strcmp(m_internalName.c_str(), "") == 0) || (obj.m_internalName.c_str() == NULL) || (strcmp(obj.m_internalName.c_str(), "") == 0)) { // Shallow equal if(strcmp(getName(), obj.getName()) != 0){ - return false; + DBUG_PRINT("info",("name %s != %s",getName(),obj.getName())); + DBUG_RETURN(false); } } else // Deep equal if(strcmp(m_internalName.c_str(), obj.m_internalName.c_str()) != 0){ - return false; + { + DBUG_PRINT("info",("m_internalName %s != %s", + m_internalName.c_str(),obj.m_internalName.c_str())); + DBUG_RETURN(false); + } } if(m_fragmentType != obj.m_fragmentType){ - return false; + DBUG_PRINT("info",("m_fragmentType %d != %d",m_fragmentType,obj.m_fragmentType)); + DBUG_RETURN(false); } if(m_columns.size() != obj.m_columns.size()){ - return false; + DBUG_PRINT("info",("m_columns.size %d != %d",m_columns.size(),obj.m_columns.size())); + DBUG_RETURN(false); } for(unsigned i = 0; i<obj.m_columns.size(); i++){ if(!m_columns[i]->equal(* obj.m_columns[i])){ - return false; + DBUG_PRINT("info",("m_columns [%d] != [%d]",i,i)); + DBUG_RETURN(false); } } if(m_logging != obj.m_logging){ - return false; + DBUG_PRINT("info",("m_logging %d != %d",m_logging,obj.m_logging)); + DBUG_RETURN(false); } if(m_kvalue != obj.m_kvalue){ - return false; + DBUG_PRINT("info",("m_kvalue %d != %d",m_kvalue,obj.m_kvalue)); + DBUG_RETURN(false); } if(m_minLoadFactor != obj.m_minLoadFactor){ - return false; + DBUG_PRINT("info",("m_minLoadFactor %d != %d",m_minLoadFactor,obj.m_minLoadFactor)); + DBUG_RETURN(false); } if(m_maxLoadFactor != obj.m_maxLoadFactor){ - return false; + DBUG_PRINT("info",("m_maxLoadFactor %d != %d",m_maxLoadFactor,obj.m_maxLoadFactor)); + DBUG_RETURN(false); } - return true; + DBUG_RETURN(true); } void diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp index 40eb46ea397..40aaa1e3daa 100644 --- a/ndb/src/ndbapi/Ndbif.cpp +++ b/ndb/src/ndbapi/Ndbif.cpp @@ -388,24 +388,24 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) com = tRec->execTRANSID_AI(tDataPtr + TransIdAI::HeaderLength, tLen - TransIdAI::HeaderLength); } + + if(com == 0) + return; - if(com == 1){ - switch(tRec->getType()){ - case NdbReceiver::NDB_OPERATION: - case NdbReceiver::NDB_INDEX_OPERATION: - if(tCon->OpCompleteSuccess() != -1){ - completedTransaction(tCon); - return; - } - break; - case NdbReceiver::NDB_SCANRECEIVER: - tCon->theScanningOp->receiver_delivered(tRec); - theImpl->theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? - (Uint32) NO_WAIT : tWaitState); - break; - default: - goto InvalidSignal; + switch(tRec->getType()){ + case NdbReceiver::NDB_OPERATION: + case NdbReceiver::NDB_INDEX_OPERATION: + if(tCon->OpCompleteSuccess() != -1){ + completedTransaction(tCon); } + return; + case NdbReceiver::NDB_SCANRECEIVER: + tCon->theScanningOp->receiver_delivered(tRec); + theImpl->theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? + (Uint32) NO_WAIT : tWaitState); + break; + default: + goto InvalidSignal; } break; } else { diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index 20d98c63a67..5b5394f0965 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -405,11 +405,8 @@ extern "C" void* runSendRequest_C(void * me) { - my_thread_init(); ((TransporterFacade*) me)->threadMainSend(); - my_thread_end(); - NdbThread_Exit(0); - return me; + return 0; } void TransporterFacade::threadMainSend(void) @@ -443,11 +440,8 @@ extern "C" void* runReceiveResponse_C(void * me) { - my_thread_init(); ((TransporterFacade*) me)->threadMainReceive(); - my_thread_end(); - NdbThread_Exit(0); - return me; + return 0; } void TransporterFacade::threadMainReceive(void) diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index 56c007350e6..4a33be7c597 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -87,11 +87,8 @@ const char *Ndb_cluster_connection::get_connectstring(char *buf, extern "C" pthread_handler_decl(run_ndb_cluster_connection_connect_thread, me) { - my_thread_init(); g_run_connect_thread= 1; ((Ndb_cluster_connection_impl*) me)->connect_thread(); - my_thread_end(); - NdbThread_Exit(0); return me; } @@ -508,7 +505,7 @@ int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, CFG_CONNECTION_SERVER_PORT, m_impl.m_transporter_facade->get_registry() ->m_transporter_interface[i] - .m_service_port, + .m_s_service_port, &mgm_reply); ndb_mgm_destroy_configuration(props); |