break;#ifdef VM_TRACE default: abort();#endif } }}intNdbIndexScanOperation::compare(Uint32 skip, Uint32 cols, const NdbReceiver* t1, const NdbReceiver* t2){ NdbRecAttr * r1 = t1->m_rows[t1->m_current_row]; NdbRecAttr * r2 = t2->m_rows[t2->m_current_row]; r1 = (skip ? r1->next() : r1); r2 = (skip ? r2->next() : r2); const int jdir = 1 - 2 * (int)m_descending; assert(jdir == 1 || jdir == -1); while(cols > 0){ Uint32 * d1 = (Uint32*)r1->aRef(); Uint32 * d2 = (Uint32*)r2->aRef(); unsigned r1_null = r1->isNULL(); if((r1_null ^ (unsigned)r2->isNULL())){ return (r1_null ? -1 : 1) * jdir; } const NdbColumnImpl & col = NdbColumnImpl::getImpl(* r1->m_column); Uint32 len = r1->theAttrSize * r1->theArraySize; if(!r1_null){ const NdbSqlUtil::Type& sqlType = NdbSqlUtil::getType(col.m_type); int r = (*sqlType.m_cmp)(col.m_cs, d1, len, d2, len, true); if(r){assert(r != NdbSqlUtil::CmpUnknown);return r * jdir; } } cols--; r1 = r1->next(); r2 = r2->next(); } return 0;}intNdbIndexScanOperation::next_result_ordered(bool fetchAllowed, bool forceSend){ m_curr_row = 0; Uint32 u_idx = 0, u_last = 0; Uint32 s_idx = m_current_api_receiver; // first sorted Uint32 s_last = theParallelism; // last sorted NdbReceiver** arr = m_api_receivers; NdbReceiver* tRec = arr[s_idx]; if(DEBUG_NEXT_RESULT) ndbout_c("nextOrderedResult(%d) nextResult: %d", fetchAllowed, (s_idx < s_last ? tRec->nextResult() : 0)); if(DEBUG_NEXT_RESULT) ndbout_c("u=[%d %d] s=[%d %d]", u_idx, u_last, s_idx, s_last); bool fetchNeeded = (s_idx == s_last) || !tRec->nextResult(); if(fetchNeeded){ if(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->the