diff --git a/storage/ndb/src/ndbapi/NdbScanOperation.cpp b/storage/ndb/src/ndbapi/NdbScanOperation.cpp index 863eb36..8a3293b 100644 --- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp @@ -2112,7 +2112,7 @@ NdbScanOperation::takeOverScanOp(OperationType opType, NdbTransaction* pTrans) */ Uint32 infoword= 0; Uint32 len= 0; - const Uint32 *src= NULL; + const char *src= NULL; Uint32 idx= m_current_api_receiver; if (idx >= m_api_receivers_count) @@ -2120,7 +2120,7 @@ NdbScanOperation::takeOverScanOp(OperationType opType, NdbTransaction* pTrans) const NdbReceiver *receiver= m_api_receivers[m_current_api_receiver]; /* Get this row's KeyInfo data */ - int res= receiver->get_keyinfo20(infoword, len, (const char*&) src); + int res= receiver->get_keyinfo20(infoword, len, src); if (res == -1) return NULL; @@ -2160,11 +2160,10 @@ NdbScanOperation::takeOverScanOp(OperationType opType, NdbTransaction* pTrans) // Copy the first 8 words of key info from KEYINF20 into TCKEYREQ TcKeyReq * tcKeyReq = CAST_PTR(TcKeyReq,newOp->theTCREQ->getDataPtrSend()); - Uint32 i = 0; - for (i = 0; i < TcKeyReq::MaxKeyInfo && i < len; i++) { - tcKeyReq->keyInfo[i] = * src++; - } - + Uint32 i = MIN(TcKeyReq::MaxKeyInfo, len); + memcpy(tcKeyReq->keyInfo, src, 4*i); + src += i * 4; + if(i < len){ NdbApiSignal* tSignal = theNdb->getSignal(); newOp->theTCREQ->next(tSignal); @@ -2174,7 +2173,7 @@ NdbScanOperation::takeOverScanOp(OperationType opType, NdbTransaction* pTrans) tSignal->setSignal(GSN_KEYINFO); KeyInfo * keyInfo = CAST_PTR(KeyInfo, tSignal->getDataPtrSend()); memcpy(keyInfo->keyData, src, 4 * KeyInfo::DataLength); - src += KeyInfo::DataLength; + src += 4 * KeyInfo::DataLength; left -= KeyInfo::DataLength; tSignal->next(theNdb->getSignal());