1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-03 20:43:11 +03:00

Merge mysql.com:/home/jonas/src/mysql-4.1-fix

into mysql.com:/home/jonas/src/mysql-4.1
This commit is contained in:
joreland@mysql.com
2004-11-29 09:17:45 +01:00
5 changed files with 172 additions and 502 deletions

View File

@@ -277,9 +277,9 @@ NdbScanOperation::fix_receivers(Uint32 parallel){
void
NdbScanOperation::receiver_delivered(NdbReceiver* tRec){
if(theError.code == 0){
if(DEBUG_NEXT_RESULT)
ndbout_c("receiver_delivered");
if(DEBUG_NEXT_RESULT)
ndbout_c("receiver_delivered");
Uint32 idx = tRec->m_list_index;
Uint32 last = m_sent_receivers_count - 1;
if(idx != last){
@@ -494,6 +494,9 @@ int NdbScanOperation::nextResult(bool fetchAllowed, bool forceSend)
Uint32 nodeId = theNdbCon->theDBnode;
TransporterFacade* tp = TransporterFacade::instance();
Guard guard(tp->theMutexPtr);
if(theError.code)
return -1;
Uint32 seq = theNdbCon->theNodeSequence;
if(seq == tp->getNodeSequence(nodeId) && send_next_scan(idx, false,
forceSend) == 0){
@@ -699,10 +702,8 @@ void NdbScanOperation::closeScan(bool forceSend)
void
NdbScanOperation::execCLOSE_SCAN_REP(){
m_api_receivers_count = 0;
m_conf_receivers_count = 0;
m_sent_receivers_count = 0;
m_current_api_receiver = m_ordered ? theParallelism : 0;
}
void NdbScanOperation::release()
@@ -1348,6 +1349,8 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed,
if(DEBUG_NEXT_RESULT) ndbout_c("performing fetch...");
TransporterFacade* tp = TransporterFacade::instance();
Guard guard(tp->theMutexPtr);
if(theError.code)
return -1;
Uint32 seq = theNdbCon->theNodeSequence;
Uint32 nodeId = theNdbCon->theDBnode;
if(seq == tp->getNodeSequence(nodeId) &&
@@ -1362,6 +1365,13 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed,
continue;
}
if(DEBUG_NEXT_RESULT) ndbout_c("return -1");
setErrorCode(4028);
return -1;
}
if(theError.code){
setErrorCode(theError.code);
if(DEBUG_NEXT_RESULT) ndbout_c("return -1");
return -1;
}
@@ -1371,11 +1381,9 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed,
memcpy(arr, m_conf_receivers, u_last * sizeof(char*));
if(DEBUG_NEXT_RESULT) ndbout_c("sent: %d recv: %d", tmp, u_last);
if(theError.code){
setErrorCode(theError.code);
if(DEBUG_NEXT_RESULT) ndbout_c("return -1");
return -1;
}
} else {
setErrorCode(4028);
return -1;
}
} else {
if(DEBUG_NEXT_RESULT) ndbout_c("return 2");
@@ -1515,6 +1523,13 @@ NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){
}
}
if(theError.code)
{
m_api_receivers_count = 0;
m_current_api_receiver = m_ordered ? theParallelism : 0;
}
/**
* move all conf'ed into api
* so that send_next_scan can check if they needs to be closed