19 #define DBTUP_INDEX_CPP
20 #include <dblqh/Dblqh.hpp>
22 #include <RefConvert.hpp>
23 #include <ndb_limits.h>
25 #include <AttributeDescriptor.hpp>
26 #include "AttributeOffset.hpp"
27 #include <AttributeHeader.hpp>
28 #include <signaldata/TuxMaint.hpp>
29 #include <signaldata/AlterIndxImpl.hpp>
34 Dbtup::tuxGetTupAddr(Uint32 fragPtrI,
42 c_page_pool.
getPtr(pagePtr, pageId);
43 lkey1 = pagePtr.p->frag_page_id;
55 FragrecordPtr fragPtr;
57 ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
59 tablePtr.i= fragPtr.p->fragTableId;
60 ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
63 Uint32* ptr, frag_page_id, err;
64 if ((ptr= alloc_fix_rec(&err,fragPtr.p,tablePtr.p, &key, &frag_page_id)) == 0)
69 pageId= key.m_page_no;
70 pageOffset= key.m_page_idx;
71 Uint32 attrDescIndex= tablePtr.p->tabDescriptor + (0 << ZAD_LOG_SIZE);
72 Uint32 attrDataOffset= AttributeOffset::getOffset(
73 tableDescriptor[attrDescIndex + 1].tabDescr);
74 node= ptr + attrDataOffset;
79 Dbtup::tuxFreeNode(Uint32 fragPtrI,
85 FragrecordPtr fragPtr;
87 ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
89 tablePtr.i= fragPtr.p->fragTableId;
90 ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
93 key.m_page_no = pageId;
94 key.m_page_idx = pageOffset;
96 Tuple_header* ptr = (Tuple_header*)get_ptr(&pagePtr, &key, tablePtr.p);
98 Uint32 attrDescIndex= tablePtr.p->tabDescriptor + (0 << ZAD_LOG_SIZE);
99 Uint32 attrDataOffset= AttributeOffset::getOffset(tableDescriptor[attrDescIndex + 1].tabDescr);
100 ndbrequire(node == (Uint32*)ptr + attrDataOffset);
102 free_fix_rec(fragPtr.p, tablePtr.p, &key, (Fix_page*)pagePtr.p);
106 Dbtup::tuxGetNode(Uint32 fragPtrI,
111 FragrecordPtr fragPtr;
113 ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
114 TablerecPtr tablePtr;
115 tablePtr.i= fragPtr.p->fragTableId;
116 ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
118 c_page_pool.
getPtr(pagePtr, pageId);
119 Uint32 attrDescIndex= tablePtr.p->tabDescriptor + (0 << ZAD_LOG_SIZE);
120 Uint32 attrDataOffset= AttributeOffset::getOffset(
121 tableDescriptor[attrDescIndex + 1].tabDescr);
122 node= ((Fix_page*)pagePtr.p)->
123 get_ptr(pageOffset, tablePtr.p->m_offsets[MM].m_fix_header_size) +
132 const Uint32* attrIds,
139 FragrecordPtr fragPtr;
141 ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
142 TablerecPtr tablePtr;
143 tablePtr.i= fragPtr.p->fragTableId;
144 ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
149 KeyReqStruct req_struct(jamBuf);
150 req_struct.tablePtrP = tablePtr.p;
151 req_struct.fragPtrP = fragPtr.p;
153 tmpOp.m_tuple_location.m_page_no= pageId;
154 tmpOp.m_tuple_location.m_page_idx= pageIndex;
155 tmpOp.op_struct.op_type = ZREAD;
156 setup_fixed_part(&req_struct, &tmpOp, tablePtr.p);
157 Tuple_header *tuple_ptr= req_struct.m_tuple_ptr;
158 if (tuple_ptr->get_tuple_version() != tupVersion)
161 OperationrecPtr opPtr;
162 opPtr.i= tuple_ptr->m_operation_ptr_i;
164 while (opPtr.i != RNIL) {
165 c_operation_pool.
getPtr(opPtr);
166 if (opPtr.p->tupVersion == tupVersion) {
168 if (!opPtr.p->m_copy_tuple_location.isNull()) {
169 req_struct.m_tuple_ptr=
170 get_copy_tuple(&opPtr.p->m_copy_tuple_location);
175 opPtr.i= opPtr.p->prevActiveOp;
176 ndbrequire(++loopGuard < (1 << ZTUP_VERSION_BITS));
181 prepare_read(&req_struct, tablePtr.p,
false);
184 int ret = readAttributes(&req_struct,
195 Dbtup::tuxReadPk(Uint32 fragPtrI, Uint32 pageId, Uint32 pageIndex, Uint32* dataOut,
bool xfrmFlag)
199 FragrecordPtr fragPtr;
201 ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
202 TablerecPtr tablePtr;
203 tablePtr.i= fragPtr.p->fragTableId;
204 ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
207 tmpOp.m_tuple_location.m_page_no= pageId;
208 tmpOp.m_tuple_location.m_page_idx= pageIndex;
210 KeyReqStruct req_struct(
this);
211 req_struct.tablePtrP = tablePtr.p;
212 req_struct.fragPtrP = fragPtr.p;
215 Uint32* ptr= get_ptr(&page_ptr, &tmpOp.m_tuple_location, tablePtr.p);
216 req_struct.m_page_ptr = page_ptr;
217 req_struct.m_tuple_ptr = (Tuple_header*)ptr;
220 if (! (req_struct.m_tuple_ptr->m_header_bits & Tuple_header::FREE))
222 req_struct.check_offset[MM]= tablePtr.p->get_check_offset(MM);
223 req_struct.check_offset[DD]= tablePtr.p->get_check_offset(DD);
225 Uint32 num_attr= tablePtr.p->m_no_of_attributes;
226 Uint32 descr_start= tablePtr.p->tabDescriptor;
227 TableDescriptor *tab_descr= &tableDescriptor[descr_start];
228 ndbrequire(descr_start + (num_attr << ZAD_LOG_SIZE) <= cnoOfTabDescrRec);
229 req_struct.attr_descr= tab_descr;
231 if(req_struct.m_tuple_ptr->m_header_bits & Tuple_header::ALLOC)
233 Uint32 opPtrI= req_struct.m_tuple_ptr->m_operation_ptr_i;
234 Operationrec* opPtrP= c_operation_pool.
getPtr(opPtrI);
235 ndbassert(!opPtrP->m_copy_tuple_location.isNull());
236 req_struct.m_tuple_ptr=
237 get_copy_tuple(&opPtrP->m_copy_tuple_location);
239 prepare_read(&req_struct, tablePtr.p,
false);
241 const Uint32* attrIds= &tableDescriptor[tablePtr.p->readKeyArray].tabDescr;
242 const Uint32 numAttrs= tablePtr.p->noOfKeyAttr;
246 ret = readAttributes(&req_struct,
257 while (n < numAttrs) {
259 Uint32
size= ah.getDataSize();
260 ndbrequire(size != 0);
261 for (Uint32 j= 0; j <
size; j++) {
262 dataOut[i + j -
n]= dataOut[i + j + 1];
267 ndbrequire((
int)i == ret);
273 if (tablePtr.p->m_bits & Tablerec::TR_RowGCI)
275 dataOut[
ret] = *req_struct.m_tuple_ptr->get_mm_gci(tablePtr.p);
285 Dbtup::accReadPk(Uint32 tableId, Uint32 fragId, Uint32 fragPageId, Uint32 pageIndex, Uint32* dataOut,
bool xfrmFlag)
289 TablerecPtr tablePtr;
290 tablePtr.i = tableId;
291 ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
293 FragrecordPtr fragPtr;
294 getFragmentrec(fragPtr, fragId, tablePtr.p);
297 Uint32 pageId = getRealpid(fragPtr.p, fragPageId);
299 int ret = tuxReadPk(fragPtr.i, pageId, pageIndex, dataOut, xfrmFlag);
314 Dbtup::tuxQueryTh(Uint32 fragPtrI,
324 FragrecordPtr fragPtr;
326 ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
327 TablerecPtr tablePtr;
328 tablePtr.i= fragPtr.p->fragTableId;
329 ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
332 c_page_pool.
getPtr(pagePtr);
334 KeyReqStruct req_struct(
this);
338 tmpOp.m_tuple_location.m_page_no = pageId;
339 tmpOp.m_tuple_location.m_page_idx = pageIndex;
340 tmpOp.op_struct.op_type = ZREAD;
341 setup_fixed_part(&req_struct, &tmpOp, tablePtr.p);
344 Tuple_header* tuple_ptr = req_struct.m_tuple_ptr;
346 OperationrecPtr currOpPtr;
347 currOpPtr.i = tuple_ptr->m_operation_ptr_i;
348 if (currOpPtr.i == RNIL) {
353 c_operation_pool.
getPtr(currOpPtr);
355 const bool sameTrans =
356 c_lqh->is_same_trans(currOpPtr.p->userpointer, transId1, transId2);
359 OperationrecPtr loopOpPtr = currOpPtr;
365 if (currOpPtr.p->nextActiveOp == RNIL) {
373 find_savepoint(loopOpPtr, 0);
374 const Uint32 op_type = loopOpPtr.p->op_struct.op_type;
376 if (op_type != ZINSERT) {
379 const Uint32 origVersion = tuple_ptr->get_tuple_version();
380 if (origVersion == tupVersion) {
391 if (find_savepoint(loopOpPtr, savepointId)) {
393 const Uint32 op_type = loopOpPtr.p->op_struct.op_type;
395 if (op_type != ZDELETE) {
398 Uint32 loopVersion = loopOpPtr.p->tupVersion;
399 if (loopVersion == tupVersion) {
413 #ifdef TIME_MEASUREMENT
414 static Uint32 time_events;
415 NDB_TICKS tot_time_passed;
416 Uint32 number_events;
419 Dbtup::execBUILD_INDX_IMPL_REQ(
Signal* signal)
422 #ifdef TIME_MEASUREMENT
430 BuildIndexPtr buildPtr;
431 if (ERROR_INSERTED(4031) || ! c_buildIndexList.
seize(buildPtr)) {
433 BuildIndexRec buildRec;
434 buildRec.m_request = *req;
435 buildRec.m_errorCode = BuildIndxImplRef::Busy;
436 if (ERROR_INSERTED(4031))
438 CLEAR_ERROR_INSERT_VALUE;
440 buildIndexReply(signal, &buildRec);
443 buildPtr.p->m_request = *req;
446 buildPtr.p->m_errorCode= BuildIndxImplRef::NoError;
447 buildPtr.p->m_outstanding = 0;
449 if (buildReq->tableId >= cnoOfTablerec) {
451 buildPtr.p->m_errorCode= BuildIndxImplRef::InvalidPrimaryTable;
454 TablerecPtr tablePtr;
455 tablePtr.i= buildReq->tableId;
456 ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
457 if (tablePtr.p->tableStatus != DEFINED) {
459 buildPtr.p->m_errorCode= BuildIndxImplRef::InvalidPrimaryTable;
463 buildPtr.p->m_build_vs =
464 (tablePtr.p->m_attributes[MM].m_no_of_varsize +
465 tablePtr.p->m_attributes[MM].m_no_of_dynamic) > 0;
466 if (DictTabInfo::isOrderedIndex(buildReq->indexType)) {
469 tablePtr.p->tuxCustomTriggers;
471 TriggerPtr triggerPtr;
472 triggerList.
first(triggerPtr);
473 while (triggerPtr.i != RNIL) {
474 if (triggerPtr.p->indexId == buildReq->indexId) {
478 triggerList.
next(triggerPtr);
480 if (triggerPtr.i == RNIL) {
484 buildPtr.p->m_errorCode = BuildIndxImplRef::InternalError;
487 buildPtr.p->m_indexId = buildReq->indexId;
488 buildPtr.p->m_buildRef = DBTUX;
490 req->indexId = buildReq->indexId;
492 req->requestType = AlterIndxImplReq::AlterIndexBuilding;
494 AlterIndxImplReq::SignalLength);
495 }
else if(buildReq->indexId == RNIL) {
498 buildPtr.p->m_indexId = RNIL;
499 buildPtr.p->m_buildRef = DBACC;
502 buildPtr.p->m_errorCode = BuildIndxImplRef::InvalidIndexType;
507 const Uint32 firstTupleNo = 0;
508 buildPtr.p->m_fragNo= 0;
509 buildPtr.p->m_pageId= 0;
510 buildPtr.p->m_tupleNo= firstTupleNo;
513 bool offline = !!(buildReq->requestType&BuildIndxImplReq::RF_BUILD_OFFLINE);
514 if (offline && m_max_parallel_index_build > 1)
517 buildIndexOffline(signal, buildPtr.i);
522 buildIndex(signal, buildPtr.i);
527 buildIndexReply(signal, buildPtr.p);
528 c_buildIndexList.
release(buildPtr);
532 Dbtup::buildIndex(
Signal* signal, Uint32 buildPtrI)
535 BuildIndexPtr buildPtr;
536 buildPtr.i= buildPtrI;
537 c_buildIndexList.
getPtr(buildPtr);
540 TablerecPtr tablePtr;
541 tablePtr.i= buildReq->tableId;
542 ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
544 const Uint32 firstTupleNo = 0;
545 const Uint32 tupheadsize = tablePtr.p->m_offsets[MM].m_fix_header_size;
547 #ifdef TIME_MEASUREMENT
550 NDB_TICKS time_passed;
554 FragrecordPtr fragPtr;
555 if (buildPtr.p->m_fragNo == MAX_FRAG_PER_NODE) {
558 buildIndexReply(signal, buildPtr.p);
559 c_buildIndexList.
release(buildPtr);
562 ndbrequire(buildPtr.p->m_fragNo < MAX_FRAG_PER_NODE);
563 fragPtr.i= tablePtr.p->fragrec[buildPtr.p->m_fragNo];
564 if (fragPtr.i == RNIL) {
566 buildPtr.p->m_fragNo++;
567 buildPtr.p->m_pageId= 0;
568 buildPtr.p->m_tupleNo= firstTupleNo;
571 ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
574 if (buildPtr.p->m_pageId >= fragPtr.p->m_max_page_no) {
576 buildPtr.p->m_fragNo++;
577 buildPtr.p->m_pageId= 0;
578 buildPtr.p->m_tupleNo= firstTupleNo;
581 Uint32 realPageId= getRealpidCheck(fragPtr.p, buildPtr.p->m_pageId);
583 if (realPageId == RNIL)
589 c_page_pool.
getPtr(pagePtr, realPageId);
593 Uint32 pageIndex = ~0;
594 const Tuple_header* tuple_ptr = 0;
595 pageIndex = buildPtr.p->m_tupleNo * tupheadsize;
596 if (pageIndex + tupheadsize > Fix_page::DATA_WORDS) {
598 buildPtr.p->m_pageId++;
599 buildPtr.p->m_tupleNo= firstTupleNo;
603 if (realPageId == RNIL)
606 buildPtr.p->m_tupleNo++;
610 tuple_ptr = (Tuple_header*)&pagePtr.p->m_data[pageIndex];
612 if (tuple_ptr->m_header_bits & Tuple_header::FREE) {
614 buildPtr.p->m_tupleNo++;
617 Uint32 tupVersion= tuple_ptr->get_tuple_version();
618 OperationrecPtr pageOperPtr;
619 pageOperPtr.i= tuple_ptr->m_operation_ptr_i;
620 #ifdef TIME_MEASUREMENT
621 NdbTick_getMicroTimer(&start);
625 req->errorCode = RNIL;
626 req->tableId = tablePtr.i;
627 req->indexId = buildPtr.p->m_indexId;
628 req->fragId = tablePtr.p->fragid[buildPtr.p->m_fragNo];
629 req->pageId = realPageId;
630 req->tupVersion = tupVersion;
631 req->opInfo = TuxMaintReq::OpAdd;
632 req->tupFragPtrI = fragPtr.i;
633 req->fragPageId = buildPtr.p->m_pageId;
634 req->pageIndex = pageIndex;
636 if (pageOperPtr.i == RNIL)
639 signal, TuxMaintReq::SignalLength+2);
671 c_operation_pool.
getPtr(pageOperPtr);
672 while (pageOperPtr.p->prevActiveOp != RNIL)
675 pageOperPtr.i = pageOperPtr.p->prevActiveOp;
676 c_operation_pool.
getPtr(pageOperPtr);
688 if (pageOperPtr.p->op_struct.op_type == ZUPDATE)
691 req->errorCode = RNIL;
692 req->tupVersion = decr_tup_version(pageOperPtr.p->tupVersion);
694 signal, TuxMaintReq::SignalLength+2);
695 ok = (req->errorCode == 0);
713 while (pageOperPtr.i != RNIL && ok)
716 c_operation_pool.
getPtr(pageOperPtr);
717 req->errorCode = RNIL;
718 req->tupVersion = pageOperPtr.p->tupVersion;
720 signal, TuxMaintReq::SignalLength+2);
721 pageOperPtr.i = pageOperPtr.p->nextActiveOp;
722 ok = (req->errorCode == 0);
727 if (req->errorCode != 0) {
728 switch (req->errorCode) {
729 case TuxMaintReq::NoMemError:
731 buildPtr.p->m_errorCode= BuildIndxImplRef::AllocationFailure;
737 buildIndexReply(signal, buildPtr.p);
738 c_buildIndexList.
release(buildPtr);
741 #ifdef TIME_MEASUREMENT
742 NdbTick_getMicroTimer(&stop);
743 time_passed= NdbTick_getMicrosPassed(start, stop);
744 if (time_passed < 1000) {
746 tot_time_passed += time_passed;
747 if (time_events == number_events) {
748 NDB_TICKS mean_time_passed= tot_time_passed /
749 (NDB_TICKS)number_events;
750 ndbout <<
"Number of events= " << number_events;
751 ndbout <<
" Mean time passed= " << mean_time_passed << endl;
753 tot_time_passed= (NDB_TICKS)0;
759 buildPtr.p->m_tupleNo++;
762 signal->theData[0]= ZBUILD_INDEX;
763 signal->theData[1]= buildPtr.i;
764 sendSignal(reference(), GSN_CONTINUEB, signal, 2, JBB);
767 Uint32 Dbtux_mt_buildIndexFragment_wrapper_C(
void*);
770 Dbtup::buildIndexOffline(
Signal* signal, Uint32 buildPtrI)
776 BuildIndexPtr buildPtr;
777 buildPtr.i= buildPtrI;
778 c_buildIndexList.
getPtr(buildPtr);
783 bzero(req,
sizeof(req));
784 req->senderRef = reference();
785 req->senderData = buildPtrI;
786 req->tableId = buildReq->tableId;
787 req->requestType = AlterTabReq::AlterTableReadOnly;
788 sendSignal(calcInstanceBlockRef(DBLQH), GSN_ALTER_TAB_REQ, signal,
789 AlterTabReq::SignalLength, JBB);
793 Dbtup::execALTER_TAB_CONF(
Signal* signal)
798 BuildIndexPtr buildPtr;
799 buildPtr.i = conf->senderData;
800 c_buildIndexList.
getPtr(buildPtr);
803 if (buildPtr.p->m_fragNo == 0)
806 buildIndexOffline_table_readonly(signal, conf->senderData);
812 ndbrequire(buildPtr.p->m_fragNo >= MAX_FRAG_PER_NODE);
813 buildIndexReply(signal, buildPtr.p);
814 c_buildIndexList.
release(buildPtr);
820 Dbtup::buildIndexOffline_table_readonly(
Signal* signal, Uint32 buildPtrI)
823 BuildIndexPtr buildPtr;
824 buildPtr.i= buildPtrI;
825 c_buildIndexList.
getPtr(buildPtr);
829 TablerecPtr tablePtr;
830 tablePtr.i= buildReq->tableId;
831 ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
833 for (;buildPtr.p->m_fragNo < MAX_FRAG_PER_NODE;
834 buildPtr.p->m_fragNo++)
837 FragrecordPtr fragPtr;
838 fragPtr.i = tablePtr.p->fragrec[buildPtr.p->m_fragNo];
839 if (fragPtr.i == RNIL)
844 ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
846 bzero(&req,
sizeof(req));
847 req.senderRef = reference();
848 req.senderData = buildPtr.i;
849 req.tableId = buildReq->tableId;
850 req.indexId = buildPtr.p->m_indexId;
851 req.fragId = tablePtr.p->fragid[buildPtr.p->m_fragNo];
856 tux = tux->getInstance(instance());
857 ndbrequire(tux != 0);
861 req.func_ptr = Dbtux_mt_buildIndexFragment_wrapper_C;
862 req.buffer_size = 16*32768;
864 Uint32 * req_ptr = signal->getDataPtrSend();
865 memcpy(req_ptr, &req,
sizeof(req));
867 sendSignal(NDBFS_REF, GSN_BUILD_INDX_IMPL_REQ, signal,
868 (
sizeof(req) + 15) / 4, JBB);
870 buildPtr.p->m_outstanding++;
871 if (buildPtr.p->m_outstanding >= m_max_parallel_index_build)
878 if (buildPtr.p->m_outstanding == 0)
882 bzero(req,
sizeof(req));
883 req->senderRef = reference();
884 req->senderData = buildPtrI;
885 req->tableId = buildReq->tableId;
886 req->requestType = AlterTabReq::AlterTableReadWrite;
887 sendSignal(calcInstanceBlockRef(DBLQH), GSN_ALTER_TAB_REQ, signal,
888 AlterTabReq::SignalLength, JBB);
900 Dbtup::mt_scan_init(Uint32 tableId, Uint32 fragId,
903 TablerecPtr tablePtr;
904 tablePtr.i = tableId;
905 ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
907 FragrecordPtr fragPtr;
909 for (Uint32 i = 0; i<MAX_FRAG_PER_NODE; i++)
911 if (tablePtr.p->fragid[i] == fragId)
913 fragPtr.i = tablePtr.p->fragrec[
i];
918 if (fragPtr.i == RNIL)
921 ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
923 Uint32 fragPageId = 0;
924 while (fragPageId < fragPtr.p->m_max_page_no)
926 Uint32 realPageId= getRealpidCheck(fragPtr.p, fragPageId);
927 if (realPageId != RNIL)
929 * fragPtrI = fragPtr.i;
930 pos->m_page_no = realPageId;
942 Dbtup::mt_scan_next(Uint32 tableId, Uint32 fragPtrI,
945 TablerecPtr tablePtr;
946 tablePtr.i = tableId;
947 ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
949 FragrecordPtr fragPtr;
950 fragPtr.i = fragPtrI;
951 ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
953 Uint32 tupheadsize = tablePtr.p->m_offsets[MM].m_fix_header_size;
956 pos->m_page_idx += tupheadsize;
960 c_page_pool.
getPtr(pagePtr, pos->m_page_no);
964 Tuple_header* tuple_ptr;
965 while (pos->m_page_idx + tupheadsize <= Fix_page::DATA_WORDS)
967 tuple_ptr = (Tuple_header*)(pagePtr.p->m_data + pos->m_page_idx);
969 if (tuple_ptr->m_header_bits & Tuple_header::FREE)
971 pos->m_page_idx += tupheadsize;
974 pos->m_file_no = tuple_ptr->get_tuple_version();
979 Uint32 fragPageId = pagePtr.p->frag_page_id + 1;
980 while (fragPageId < fragPtr.p->m_max_page_no)
982 Uint32 realPageId = getRealpidCheck(fragPtr.p, fragPageId);
983 if (realPageId != RNIL)
985 pos->m_page_no = realPageId;
991 if (fragPageId == fragPtr.p->m_max_page_no)
995 c_page_pool.
getPtr(pagePtr, pos->m_page_no);
1002 Dbtup::execBUILD_INDX_IMPL_REF(
Signal* signal)
1006 Uint32 ptr = ref->senderData;
1007 Uint32 err = ref->errorCode;
1009 BuildIndexPtr buildPtr;
1010 c_buildIndexList.
getPtr(buildPtr, ptr);
1011 ndbrequire(buildPtr.p->m_outstanding);
1012 buildPtr.p->m_outstanding--;
1014 buildPtr.p->m_errorCode = (BuildIndxImplRef::ErrorCode)err;
1015 buildPtr.p->m_fragNo = MAX_FRAG_PER_NODE;
1016 buildIndexOffline_table_readonly(signal, ptr);
1020 Dbtup::execBUILD_INDX_IMPL_CONF(
Signal* signal)
1024 Uint32 ptr = conf->senderData;
1026 BuildIndexPtr buildPtr;
1027 c_buildIndexList.
getPtr(buildPtr, ptr);
1028 ndbrequire(buildPtr.p->m_outstanding);
1029 buildPtr.p->m_outstanding--;
1030 buildPtr.p->m_fragNo++;
1032 buildIndexOffline_table_readonly(signal, ptr);
1036 Dbtup::buildIndexReply(
Signal* signal,
const BuildIndexRec* buildPtrP)
1041 req->indexId = buildReq->indexId;
1043 if (buildPtrP->m_errorCode == BuildIndxImplRef::NoError)
1046 req->requestType = AlterIndxImplReq::AlterIndexOnline;
1051 req->requestType = AlterIndxImplReq::AlterIndexOffline;
1054 AlterIndxImplReq::SignalLength);
1056 if (buildPtrP->m_errorCode == BuildIndxImplRef::NoError) {
1060 conf->senderRef = reference();
1061 conf->senderData = buildReq->senderData;
1063 sendSignal(buildReq->senderRef, GSN_BUILD_INDX_IMPL_CONF,
1064 signal, BuildIndxImplConf::SignalLength, JBB);
1069 ref->senderRef = reference();
1070 ref->senderData = buildReq->senderData;
1071 ref->errorCode = buildPtrP->m_errorCode;
1073 sendSignal(buildReq->senderRef, GSN_BUILD_INDX_IMPL_REF,
1074 signal, BuildIndxImplRef::SignalLength, JBB);