19 #define DBTUP_COMMIT_CPP
21 #include <RefConvert.hpp>
22 #include <ndb_limits.h>
24 #include <signaldata/TupCommit.hpp>
25 #include "../dblqh/Dblqh.hpp"
27 void Dbtup::execTUP_DEALLOCREQ(
Signal* signal)
29 TablerecPtr regTabPtr;
30 FragrecordPtr regFragPtr;
31 Uint32 frag_page_id, frag_id;
35 frag_id= signal->theData[0];
36 regTabPtr.i= signal->theData[1];
37 frag_page_id= signal->theData[2];
38 Uint32 page_index= signal->theData[3];
40 ptrCheckGuard(regTabPtr, cnoOfTablerec, tablerec);
42 getFragmentrec(regFragPtr, frag_id, regTabPtr.p);
43 ndbassert(regFragPtr.p != NULL);
45 if (! Local_key::isInvalid(frag_page_id, page_index))
48 tmp.m_page_no= getRealpid(regFragPtr.p, frag_page_id);
49 tmp.m_page_idx= page_index;
52 Tuple_header* ptr= (Tuple_header*)get_ptr(&pagePtr, &tmp, regTabPtr.p);
54 ndbassert(ptr->m_header_bits & Tuple_header::FREED);
56 if (regTabPtr.p->m_attributes[MM].m_no_of_varsize +
57 regTabPtr.p->m_attributes[MM].m_no_of_dynamic)
60 free_var_rec(regFragPtr.p, regTabPtr.p, &tmp, pagePtr);
62 free_fix_rec(regFragPtr.p, regTabPtr.p, &tmp, (Fix_page*)pagePtr.p);
67 void Dbtup::execTUP_WRITELOG_REQ(
Signal* signal)
70 OperationrecPtr loopOpPtr;
71 loopOpPtr.i= signal->theData[0];
72 Uint32 gci_hi = signal->theData[1];
73 Uint32 gci_lo = signal->theData[2];
74 c_operation_pool.
getPtr(loopOpPtr);
75 while (loopOpPtr.p->prevActiveOp != RNIL) {
77 loopOpPtr.i= loopOpPtr.p->prevActiveOp;
78 c_operation_pool.
getPtr(loopOpPtr);
81 ndbrequire(get_trans_state(loopOpPtr.p) == TRANS_STARTED);
82 signal->theData[0] = loopOpPtr.p->userpointer;
83 signal->theData[1] = gci_hi;
84 signal->theData[2] = gci_lo;
85 if (loopOpPtr.p->nextActiveOp == RNIL) {
93 loopOpPtr.i= loopOpPtr.p->nextActiveOp;
94 c_operation_pool.
getPtr(loopOpPtr);
101 void Dbtup::initOpConnection(Operationrec* regOperPtr)
103 set_tuple_state(regOperPtr, TUPLE_ALREADY_ABORTED);
104 set_trans_state(regOperPtr, TRANS_IDLE);
105 regOperPtr->op_struct.op_type= ZREAD;
106 regOperPtr->op_struct.m_disk_preallocated= 0;
107 regOperPtr->op_struct.m_load_diskpage_on_commit= 0;
108 regOperPtr->op_struct.m_wait_log_buffer= 0;
109 regOperPtr->op_struct.in_active_list =
false;
110 regOperPtr->m_undo_buffer_space= 0;
114 Dbtup::is_rowid_lcp_scanned(
const Local_key& key1,
118 switch (op.m_state) {
119 case Dbtup::ScanOp::First:
120 ndbrequire(key2.isNull());
122 case Dbtup::ScanOp::Current:
123 case Dbtup::ScanOp::Next:
124 ndbrequire(!key2.isNull());
125 if (key1.m_page_no < key2.m_page_no)
127 if (key1.m_page_no > key2.m_page_no)
129 if (key1.m_page_idx < key2.m_page_idx)
131 if (key1.m_page_idx > key2.m_page_idx)
136 if (op.m_state == Dbtup::ScanOp::Next)
139 case Dbtup::ScanOp::Last:
149 Dbtup::dealloc_tuple(
Signal* signal,
154 KeyReqStruct * req_struct,
155 Operationrec* regOperPtr,
156 Fragrecord* regFragPtr,
159 Uint32 lcpScan_ptr_i= regFragPtr->m_lcp_scan_op;
161 Uint32 bits = ptr->m_header_bits;
162 Uint32 extra_bits = Tuple_header::FREED;
163 if (bits & Tuple_header::DISK_PART)
167 memcpy(&disk, ptr->get_disk_ref_ptr(regTabPtr),
sizeof(disk));
169 tmpptr.i = m_pgman_ptr.i;
170 tmpptr.p =
reinterpret_cast<Page*
>(m_pgman_ptr.p);
171 disk_page_free(signal, regTabPtr, regFragPtr,
172 &disk, tmpptr, gci_hi);
175 if (! (bits & (Tuple_header::LCP_SKIP | Tuple_header::ALLOC)) &&
176 lcpScan_ptr_i != RNIL && regTabPtr->m_no_of_disk_attributes > 0)
180 c_scanOpPool.
getPtr(scanOp, lcpScan_ptr_i);
181 Local_key rowid = regOperPtr->m_tuple_location;
182 rowid.m_page_no = page->frag_page_id;
183 if (!is_rowid_lcp_scanned(rowid, *scanOp.p))
193 handle_lcp_keep_commit(&rowid,
194 req_struct, regOperPtr, regFragPtr, regTabPtr);
198 ptr->m_header_bits = bits | extra_bits;
200 if (regTabPtr->m_bits & Tablerec::TR_RowGCI)
203 * ptr->get_mm_gci(regTabPtr) = gci_hi;
204 if (regTabPtr->m_bits & Tablerec::TR_ExtraRowGCIBits)
206 Uint32 attrId = regTabPtr->getExtraAttrId<Tablerec::TR_ExtraRowGCIBits>();
207 store_extra_row_bits(attrId, regTabPtr, ptr, gci_lo,
true);
213 Dbtup::handle_lcp_keep_commit(
const Local_key* rowid,
214 KeyReqStruct * req_struct,
215 Operationrec * opPtrP,
216 Fragrecord * regFragPtr,
217 Tablerec * regTabPtr)
221 Uint32 * copytuple = get_copy_tuple_raw(&opPtrP->m_copy_tuple_location);
222 Tuple_header * dst = get_copy_tuple(copytuple);
223 Tuple_header * org = req_struct->m_tuple_ptr;
224 if (regTabPtr->need_expand(disk))
226 setup_fixed_part(req_struct, opPtrP, regTabPtr);
227 req_struct->m_tuple_ptr = dst;
228 expand_tuple(req_struct, sizes, org, regTabPtr, disk);
229 shrink_tuple(req_struct, sizes+2, regTabPtr, disk);
233 memcpy(dst, org, 4*regTabPtr->m_offsets[MM].m_fix_header_size);
235 dst->m_header_bits |= Tuple_header::COPY_TUPLE;
243 memcpy(copytuple+0, rowid,
sizeof(
Local_key));
247 memcpy(copytuple+2, &nil,
sizeof(nil));
252 if (regFragPtr->m_lcp_keep_list_tail.isNull())
255 regFragPtr->m_lcp_keep_list_head = opPtrP->m_copy_tuple_location;
260 Uint32 * tail = get_copy_tuple_raw(®FragPtr->m_lcp_keep_list_tail);
262 memcpy(&nextptr, tail+2,
sizeof(
Local_key));
263 ndbassert(nextptr.isNull());
264 nextptr = opPtrP->m_copy_tuple_location;
265 memcpy(tail+2, &nextptr,
sizeof(
Local_key));
267 regFragPtr->m_lcp_keep_list_tail = opPtrP->m_copy_tuple_location;
272 opPtrP->m_copy_tuple_location.setNull();
276 static void dump_buf_hex(
unsigned char *p, Uint32 bytes)
282 for(Uint32
i=0;
i<bytes;
i++)
284 if(
i==((
sizeof(buf)/3)-1))
289 sprintf(q+3*
i,
" %02X", p[
i]);
291 ndbout_c(
"%8p: %s", p, buf);
296 Dbtup::commit_operation(
Signal* signal,
299 Tuple_header* tuple_ptr,
301 Operationrec* regOperPtr,
302 Fragrecord* regFragPtr,
305 ndbassert(regOperPtr->op_struct.op_type != ZDELETE);
307 Uint32 lcpScan_ptr_i= regFragPtr->m_lcp_scan_op;
308 Uint32 save= tuple_ptr->m_operation_ptr_i;
309 Uint32 bits= tuple_ptr->m_header_bits;
311 Tuple_header *disk_ptr= 0;
312 Tuple_header *copy= get_copy_tuple(®OperPtr->m_copy_tuple_location);
314 Uint32 copy_bits= copy->m_header_bits;
316 Uint32 fixsize= regTabPtr->m_offsets[MM].m_fix_header_size;
317 Uint32 mm_vars= regTabPtr->m_attributes[MM].m_no_of_varsize;
318 Uint32 mm_dyns= regTabPtr->m_attributes[MM].m_no_of_dynamic;
319 bool update_gci_at_commit = ! regOperPtr->op_struct.m_gci_written;
320 if((mm_vars+mm_dyns) == 0)
323 memcpy(tuple_ptr, copy, 4*fixsize);
324 disk_ptr= (Tuple_header*)(((Uint32*)copy)+fixsize);
335 Var_part_ref *ref= tuple_ptr->get_var_part_ref_ptr(regTabPtr);
338 memcpy(tuple_ptr, copy, 4*fixsize);
342 if (copy_bits & Tuple_header::VAR_PART)
345 ndbassert(bits & Tuple_header::VAR_PART);
346 ndbassert(tmp.m_page_no != RNIL);
347 ndbassert(copy_bits & Tuple_header::COPY_TUPLE);
349 Uint32 *dst= get_ptr(&vpagePtr, *ref);
350 Var_page* vpagePtrP = (Var_page*)vpagePtr.p;
351 Varpart_copy*vp =(Varpart_copy*)copy->get_end_of_fix_part_ptr(regTabPtr);
353 Uint32 len = vp->m_len;
354 memcpy(dst, vp->m_data, 4*len);
356 if(copy_bits & Tuple_header::MM_SHRINK)
359 ndbassert(vpagePtrP->get_entry_len(tmp.m_page_idx) >= len);
363 vpagePtrP->shrink_entry(tmp.m_page_idx, len);
364 update_free_page_list(regFragPtr, vpagePtr);
369 free_var_part(regFragPtr, vpagePtr, tmp.m_page_idx);
370 tmp.m_page_no = RNIL;
372 copy_bits &= ~(Uint32)Tuple_header::VAR_PART;
378 ndbassert(vpagePtrP->get_entry_len(tmp.m_page_idx) == len);
385 disk_ptr = (Tuple_header*)(vp->m_data + len);
390 ndbassert(tmp.m_page_no == RNIL);
391 disk_ptr = (Tuple_header*)copy->get_end_of_fix_part_ptr(regTabPtr);
395 if (regTabPtr->m_no_of_disk_attributes &&
396 (copy_bits & Tuple_header::DISK_INLINE))
400 memcpy(&key, copy->get_disk_ref_ptr(regTabPtr),
sizeof(
Local_key));
401 Uint32 logfile_group_id= regFragPtr->m_logfile_group_id;
403 PagePtr diskPagePtr = { (
Tup_page*)m_pgman_ptr.p, m_pgman_ptr.i };
404 ndbassert(diskPagePtr.p->m_page_no == key.m_page_no);
405 ndbassert(diskPagePtr.p->m_file_no == key.m_file_no);
407 if(copy_bits & Tuple_header::DISK_ALLOC)
410 disk_page_alloc(signal, regTabPtr, regFragPtr, &key, diskPagePtr, gci_hi);
413 if(regTabPtr->m_attributes[DD].m_no_of_varsize == 0)
416 sz= regTabPtr->m_offsets[DD].m_fix_header_size;
417 dst= ((Fix_page*)diskPagePtr.p)->get_ptr(key.m_page_idx, sz);
422 dst= ((Var_page*)diskPagePtr.p)->get_ptr(key.m_page_idx);
423 sz= ((Var_page*)diskPagePtr.p)->get_entry_len(key.m_page_idx);
426 if(! (copy_bits & Tuple_header::DISK_ALLOC))
429 disk_page_undo_update(diskPagePtr.p,
430 &key, dst, sz, gci_hi, logfile_group_id);
433 memcpy(dst, disk_ptr, 4*sz);
434 memcpy(tuple_ptr->get_disk_ref_ptr(regTabPtr), &key,
sizeof(
Local_key));
436 ndbassert(! (disk_ptr->m_header_bits & Tuple_header::FREE));
437 copy_bits |= Tuple_header::DISK_PART;
440 if(lcpScan_ptr_i != RNIL && (bits & Tuple_header::ALLOC))
444 c_scanOpPool.
getPtr(scanOp, lcpScan_ptr_i);
445 Local_key rowid = regOperPtr->m_tuple_location;
446 rowid.m_page_no = pagePtr.p->frag_page_id;
447 if (!is_rowid_lcp_scanned(rowid, *scanOp.p))
450 copy_bits |= Tuple_header::LCP_SKIP;
455 Tuple_header::ALLOC | Tuple_header::FREE | Tuple_header::COPY_TUPLE |
456 Tuple_header::DISK_ALLOC | Tuple_header::DISK_INLINE |
457 Tuple_header::MM_SHRINK | Tuple_header::MM_GROWN;
458 copy_bits &= ~(Uint32)clear;
460 tuple_ptr->m_header_bits= copy_bits;
461 tuple_ptr->m_operation_ptr_i= save;
463 if (regTabPtr->m_bits & Tablerec::TR_RowGCI &&
464 update_gci_at_commit)
467 * tuple_ptr->get_mm_gci(regTabPtr) = gci_hi;
468 if (regTabPtr->m_bits & Tablerec::TR_ExtraRowGCIBits)
470 Uint32 attrId = regTabPtr->getExtraAttrId<Tablerec::TR_ExtraRowGCIBits>();
471 store_extra_row_bits(attrId, regTabPtr, tuple_ptr, gci_lo,
476 if (regTabPtr->m_bits & Tablerec::TR_Checksum) {
478 setChecksum(tuple_ptr, regTabPtr);
483 Dbtup::disk_page_commit_callback(
Signal* signal,
484 Uint32 opPtrI, Uint32 page_id)
487 Uint32 gci_hi, gci_lo;
488 Uint32 transId1, transId2;
489 OperationrecPtr regOperPtr;
493 c_operation_pool.
getPtr(regOperPtr, opPtrI);
494 c_lqh->get_op_info(regOperPtr.p->userpointer, &hash_value, &gci_hi, &gci_lo,
495 &transId1, &transId2);
499 tupCommitReq->opPtr= opPtrI;
500 tupCommitReq->hashValue= hash_value;
501 tupCommitReq->gci_hi= gci_hi;
502 tupCommitReq->gci_lo= gci_lo;
503 tupCommitReq->diskpage = page_id;
504 tupCommitReq->transId1 = transId1;
505 tupCommitReq->transId2 = transId2;
507 regOperPtr.p->op_struct.m_load_diskpage_on_commit= 0;
508 regOperPtr.p->m_commit_disk_callback_page= page_id;
509 m_global_page_pool.
getPtr(m_pgman_ptr, page_id);
513 tmp.i = m_pgman_ptr.i;
514 tmp.p =
reinterpret_cast<Page*
>(m_pgman_ptr.p);
515 disk_page_set_dirty(tmp);
518 execTUP_COMMITREQ(signal);
519 if(signal->theData[0] == 0)
522 c_lqh->tupcommit_conf_callback(signal, regOperPtr.p->userpointer);
527 Dbtup::disk_page_log_buffer_callback(
Signal* signal,
532 Uint32 gci_hi, gci_lo;
533 Uint32 transId1, transId2;
534 OperationrecPtr regOperPtr;
538 c_operation_pool.
getPtr(regOperPtr, opPtrI);
539 c_lqh->get_op_info(regOperPtr.p->userpointer, &hash_value, &gci_hi, &gci_lo,
540 &transId1, &transId2);
541 Uint32 page= regOperPtr.p->m_commit_disk_callback_page;
545 tupCommitReq->opPtr= opPtrI;
546 tupCommitReq->hashValue= hash_value;
547 tupCommitReq->gci_hi= gci_hi;
548 tupCommitReq->gci_lo= gci_lo;
549 tupCommitReq->diskpage =
page;
550 tupCommitReq->transId1 = transId1;
551 tupCommitReq->transId2 = transId2;
553 ndbassert(regOperPtr.p->op_struct.m_load_diskpage_on_commit == 0);
554 regOperPtr.p->op_struct.m_wait_log_buffer= 0;
555 m_global_page_pool.
getPtr(m_pgman_ptr, page);
557 execTUP_COMMITREQ(signal);
558 ndbassert(signal->theData[0] == 0);
560 c_lqh->tupcommit_conf_callback(signal, regOperPtr.p->userpointer);
563 int Dbtup::retrieve_data_page(
Signal *signal,
565 OperationrecPtr regOperPtr)
567 req.m_callback.m_callbackData= regOperPtr.i;
568 req.m_callback.m_callbackFunction =
569 safe_cast(&Dbtup::disk_page_commit_callback);
575 int flags= regOperPtr.p->op_struct.op_type |
576 Page_cache_client::COMMIT_REQ | Page_cache_client::CORR_REQ;
578 int res= pgman.get_page(signal, req, flags);
579 m_pgman_ptr = pgman.m_ptr;
587 signal->theData[0] = 1;
590 ndbrequire(
"NOT YET IMPLEMENTED" == 0);
597 tmpptr.i = m_pgman_ptr.i;
598 tmpptr.p =
reinterpret_cast<Page*
>(m_pgman_ptr.p);
600 disk_page_set_dirty(tmpptr);
602 regOperPtr.p->m_commit_disk_callback_page= res;
603 regOperPtr.p->op_struct.m_load_diskpage_on_commit= 0;
608 int Dbtup::retrieve_log_page(
Signal *signal,
609 FragrecordPtr regFragPtr,
610 OperationrecPtr regOperPtr)
619 cb.m_callbackData= regOperPtr.i;
620 cb.m_callbackIndex = DISK_PAGE_LOG_BUFFER_CALLBACK;
621 Uint32 sz= regOperPtr.p->m_undo_buffer_space;
623 D(
"Logfile_client - execTUP_COMMITREQ");
624 Logfile_client lgman(
this, c_lgman, regFragPtr.p->m_logfile_group_id);
625 int res= lgman.get_log_buffer(signal, sz, &cb);
630 signal->theData[0] = 1;
633 ndbrequire(
"NOT YET IMPLEMENTED" == 0);
638 regOperPtr.p->op_struct.m_wait_log_buffer= 0;
647 Dbtup::findFirstOp(OperationrecPtr & firstPtr)
650 printf(
"Detect out-of-order commit(%u) -> ", firstPtr.i);
651 ndbassert(!firstPtr.p->is_first_operation());
652 while(firstPtr.p->prevActiveOp != RNIL)
654 firstPtr.i = firstPtr.p->prevActiveOp;
655 c_operation_pool.
getPtr(firstPtr);
657 ndbout_c(
"%u", firstPtr.i);
663 void Dbtup::execTUP_COMMITREQ(
Signal* signal)
665 FragrecordPtr regFragPtr;
666 OperationrecPtr regOperPtr;
667 TablerecPtr regTabPtr;
668 KeyReqStruct req_struct(
this, KRS_COMMIT);
669 TransState trans_state;
670 Uint32 no_of_fragrec, no_of_tablerec;
674 regOperPtr.i= tupCommitReq->opPtr;
675 Uint32 hash_value= tupCommitReq->hashValue;
676 Uint32 gci_hi = tupCommitReq->gci_hi;
677 Uint32 gci_lo = tupCommitReq->gci_lo;
678 Uint32 transId1 = tupCommitReq->transId1;
679 Uint32 transId2 = tupCommitReq->transId2;
683 c_operation_pool.
getPtr(regOperPtr);
685 regFragPtr.i= regOperPtr.p->fragmentPtr;
686 trans_state= get_trans_state(regOperPtr.p);
688 no_of_fragrec= cnoOfFragrec;
690 ndbrequire(trans_state == TRANS_STARTED);
691 ptrCheckGuard(regFragPtr, no_of_fragrec, fragrecord);
693 no_of_tablerec= cnoOfTablerec;
694 regTabPtr.i= regFragPtr.p->fragTableId;
696 req_struct.signal= signal;
697 req_struct.hash_value= hash_value;
698 req_struct.gci_hi = gci_hi;
699 req_struct.gci_lo = gci_lo;
701 req_struct.trans_id1 = transId1;
702 req_struct.trans_id2 = transId2;
703 regOperPtr.p->m_commit_disk_callback_page = tupCommitReq->diskpage;
706 if (tupCommitReq->diskpage == RNIL)
708 m_pgman_ptr.i = RNIL;
710 req_struct.m_disk_page_ptr.i = RNIL;
711 req_struct.m_disk_page_ptr.p = 0;
715 ptrCheckGuard(regTabPtr, no_of_tablerec, tablerec);
718 Tuple_header* tuple_ptr= (Tuple_header*)
719 get_ptr(&page, ®OperPtr.p->m_tuple_location, regTabPtr.p);
727 if (!regTabPtr.p->tuxCustomTriggers.isEmpty())
729 if(get_tuple_state(regOperPtr.p) == TUPLE_PREPARED)
733 OperationrecPtr loopPtr = regOperPtr;
734 if (unlikely(!regOperPtr.p->is_first_operation()))
736 findFirstOp(loopPtr);
745 while(loopPtr.i != RNIL)
747 c_operation_pool.
getPtr(loopPtr);
749 executeTuxCommitTriggers(signal,
753 set_tuple_state(loopPtr.p, TUPLE_TO_BE_COMMITTED);
754 loopPtr.i = loopPtr.p->nextActiveOp;
759 bool get_page =
false;
760 if(regOperPtr.p->op_struct.m_load_diskpage_on_commit)
769 ndbassert(tuple_ptr->m_operation_ptr_i == regOperPtr.i);
774 if(!regOperPtr.p->m_copy_tuple_location.isNull())
777 Tuple_header* tmp= get_copy_tuple(®OperPtr.p->m_copy_tuple_location);
780 tmp->get_disk_ref_ptr(regTabPtr.p),
sizeof(
Local_key));
782 if (unlikely(regOperPtr.p->op_struct.op_type == ZDELETE &&
783 tmp->m_header_bits & Tuple_header::DISK_ALLOC))
789 regOperPtr.p->op_struct.m_load_diskpage_on_commit = 0;
790 regOperPtr.p->op_struct.m_wait_log_buffer = 0;
791 disk_page_abort_prealloc(signal, regFragPtr.p,
792 &req.m_page, req.m_page.m_page_idx);
794 D(
"Logfile_client - execTUP_COMMITREQ");
795 Logfile_client lgman(
this, c_lgman, regFragPtr.p->m_logfile_group_id);
796 lgman.free_log_space(regOperPtr.p->m_undo_buffer_space);
798 if (0) ndbout_c(
"insert+delete");
807 ndbassert(regOperPtr.p->op_struct.op_type == ZDELETE);
809 tuple_ptr->get_disk_ref_ptr(regTabPtr.p),
sizeof(
Local_key));
811 ndbassert(tuple_ptr->m_header_bits & Tuple_header::DISK_PART);
814 if (retrieve_data_page(signal, req, regOperPtr) == 0)
821 if(regOperPtr.p->op_struct.m_wait_log_buffer)
828 ndbassert(tuple_ptr->m_operation_ptr_i == regOperPtr.i);
830 if (retrieve_log_page(signal, regFragPtr, regOperPtr) == 0)
838 req_struct.m_tuple_ptr = tuple_ptr;
840 Uint32 nextOp = regOperPtr.p->nextActiveOp;
841 Uint32 prevOp = regOperPtr.p->prevActiveOp;
850 regOperPtr.p->nextActiveOp = RNIL;
851 regOperPtr.p->prevActiveOp = RNIL;
852 if(tuple_ptr->m_operation_ptr_i == regOperPtr.i)
858 Uint32 disk = regOperPtr.p->m_commit_disk_callback_page;
859 set_commit_change_mask_info(regTabPtr.p, &req_struct, regOperPtr.p);
860 checkDetachedTriggers(&req_struct, regOperPtr.p, regTabPtr.p,
863 tuple_ptr->m_operation_ptr_i = RNIL;
865 if (regOperPtr.p->op_struct.op_type == ZDELETE)
870 ndbassert(tuple_ptr->m_header_bits & Tuple_header::DISK_PART);
872 dealloc_tuple(signal, gci_hi, gci_lo, page.p, tuple_ptr,
873 &req_struct, regOperPtr.p, regFragPtr.p, regTabPtr.p);
875 else if(regOperPtr.p->op_struct.op_type != ZREFRESH)
878 commit_operation(signal, gci_hi, gci_lo, tuple_ptr, page,
879 regOperPtr.p, regFragPtr.p, regTabPtr.p);
884 commit_refresh(signal, gci_hi, gci_lo, tuple_ptr, page,
885 &req_struct, regOperPtr.p, regFragPtr.p, regTabPtr.p);
891 c_operation_pool.
getPtr(nextOp)->prevActiveOp = prevOp;
896 c_operation_pool.
getPtr(prevOp)->nextActiveOp = nextOp;
899 if(!regOperPtr.p->m_copy_tuple_location.isNull())
905 initOpConnection(regOperPtr.p);
906 signal->theData[0] = 0;
910 Dbtup::set_commit_change_mask_info(
const Tablerec* regTabPtr,
911 KeyReqStruct * req_struct,
912 const Operationrec * regOperPtr)
914 Uint32 masklen = (regTabPtr->m_no_of_attributes + 31) >> 5;
915 if (regOperPtr->m_copy_tuple_location.isNull())
917 ndbassert(regOperPtr->op_struct.op_type == ZDELETE);
918 req_struct->changeMask.set();
922 Uint32 * dst = req_struct->changeMask.rep.data;
923 Uint32 * rawptr = get_copy_tuple_raw(®OperPtr->m_copy_tuple_location);
924 ChangeMask * maskptr = get_change_mask_ptr(rawptr);
925 Uint32 cols = maskptr->m_cols;
926 if (cols == regTabPtr->m_no_of_attributes)
928 memcpy(dst, maskptr->m_mask, 4*masklen);
932 ndbassert(regTabPtr->m_no_of_attributes > cols);
933 memcpy(dst, maskptr->m_mask, 4*((cols + 31) >> 5));
934 req_struct->changeMask.setRange(cols,
935 regTabPtr->m_no_of_attributes - cols);
941 Dbtup::commit_refresh(
Signal* signal,
944 Tuple_header* tuple_ptr,
946 KeyReqStruct * req_struct,
947 Operationrec* regOperPtr,
948 Fragrecord* regFragPtr,
959 switch(regOperPtr->m_copy_tuple_location.m_file_no){
960 case Operationrec::RF_SINGLE_NOT_EXIST:
961 case Operationrec::RF_MULTI_NOT_EXIST:
963 case Operationrec::RF_SINGLE_EXIST:
964 case Operationrec::RF_MULTI_EXIST:
966 commit_operation(signal, gci_hi, gci_lo, tuple_ptr, pagePtr,
967 regOperPtr, regFragPtr, regTabPtr);
974 Local_key key = regOperPtr->m_tuple_location;
975 key.m_page_no = pagePtr.p->frag_page_id;
980 c_lqh->accremoverow(signal, regOperPtr->userpointer, &key);
981 dealloc_tuple(signal, gci_hi, gci_lo, pagePtr.p, tuple_ptr,
982 req_struct, regOperPtr, regFragPtr, regTabPtr);