dbscan扫描工具mysql_ndbscanoperation.cpp 源代码在线查看 - mysql-5.0.24源码包 资源下载 虫虫电子下载站...

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值