22 #include <RefConvert.hpp>
23 #include <ndb_limits.h>
25 #include <AttributeDescriptor.hpp>
26 #include "AttributeOffset.hpp"
27 #include <AttributeHeader.hpp>
28 #include <Interpreter.hpp>
29 #include <signaldata/FsConf.hpp>
30 #include <signaldata/FsRef.hpp>
31 #include <signaldata/FsRemoveReq.hpp>
32 #include <signaldata/TupCommit.hpp>
33 #include <signaldata/TupKey.hpp>
34 #include <signaldata/NodeFailRep.hpp>
36 #include <signaldata/DropTab.hpp>
39 #include <EventLogger.hpp>
42 #define DEBUG(x) { ndbout << "TUP::" << x << endl; }
44 void Dbtup::initData()
46 cnoOfFragrec = MAX_FRAG_PER_NODE;
47 cnoOfFragoprec = MAX_FRAG_PER_NODE;
48 cnoOfAlterTabOps = MAX_FRAG_PER_NODE;
49 c_maxTriggersPerTable = ZDEFAULT_MAX_NO_TRIGGERS_PER_TABLE;
50 c_noOfBuildIndexRec = 32;
52 cCopyProcedure = RNIL;
55 cCopyOverwriteLen = 0;
68 c_extent_hash(c_extent_pool),
70 c_buildIndexList(c_buildIndexPool),
71 c_undo_buffer(&ctx.m_mm),
73 m_pages_allocated_max(0),
76 BLOCK_CONSTRUCTOR(
Dbtup);
78 addRecSignal(GSN_DEBUG_SIG, &Dbtup::execDEBUG_SIG);
79 addRecSignal(GSN_CONTINUEB, &Dbtup::execCONTINUEB);
80 addRecSignal(GSN_LCP_FRAG_ORD, &Dbtup::execLCP_FRAG_ORD);
81 addRecSignal(GSN_NODE_FAILREP, &Dbtup::execNODE_FAILREP);
83 addRecSignal(GSN_DUMP_STATE_ORD, &Dbtup::execDUMP_STATE_ORD);
84 addRecSignal(GSN_DBINFO_SCANREQ, &Dbtup::execDBINFO_SCANREQ);
85 addRecSignal(GSN_SEND_PACKED, &Dbtup::execSEND_PACKED,
true);
86 addRecSignal(GSN_STTOR, &Dbtup::execSTTOR);
87 addRecSignal(GSN_MEMCHECKREQ, &Dbtup::execMEMCHECKREQ);
88 addRecSignal(GSN_TUPKEYREQ, &Dbtup::execTUPKEYREQ);
89 addRecSignal(GSN_TUPSEIZEREQ, &Dbtup::execTUPSEIZEREQ);
90 addRecSignal(GSN_TUPRELEASEREQ, &Dbtup::execTUPRELEASEREQ);
91 addRecSignal(GSN_STORED_PROCREQ, &Dbtup::execSTORED_PROCREQ);
93 addRecSignal(GSN_CREATE_TAB_REQ, &Dbtup::execCREATE_TAB_REQ);
94 addRecSignal(GSN_TUPFRAGREQ, &Dbtup::execTUPFRAGREQ);
95 addRecSignal(GSN_TUP_ADD_ATTRREQ, &Dbtup::execTUP_ADD_ATTRREQ);
96 addRecSignal(GSN_ALTER_TAB_REQ, &Dbtup::execALTER_TAB_REQ);
97 addRecSignal(GSN_TUP_COMMITREQ, &Dbtup::execTUP_COMMITREQ);
98 addRecSignal(GSN_TUP_ABORTREQ, &Dbtup::execTUP_ABORTREQ);
99 addRecSignal(GSN_NDB_STTOR, &Dbtup::execNDB_STTOR);
100 addRecSignal(GSN_READ_CONFIG_REQ, &Dbtup::execREAD_CONFIG_REQ,
true);
103 addRecSignal(GSN_CREATE_TRIG_IMPL_REQ, &Dbtup::execCREATE_TRIG_IMPL_REQ);
104 addRecSignal(GSN_DROP_TRIG_IMPL_REQ, &Dbtup::execDROP_TRIG_IMPL_REQ);
106 addRecSignal(GSN_DROP_TAB_REQ, &Dbtup::execDROP_TAB_REQ);
108 addRecSignal(GSN_TUP_DEALLOCREQ, &Dbtup::execTUP_DEALLOCREQ);
109 addRecSignal(GSN_TUP_WRITELOG_REQ, &Dbtup::execTUP_WRITELOG_REQ);
112 addRecSignal(GSN_BUILD_INDX_IMPL_REQ, &Dbtup::execBUILD_INDX_IMPL_REQ);
113 addRecSignal(GSN_BUILD_INDX_IMPL_REF, &Dbtup::execBUILD_INDX_IMPL_REF);
114 addRecSignal(GSN_BUILD_INDX_IMPL_CONF, &Dbtup::execBUILD_INDX_IMPL_CONF);
115 addRecSignal(GSN_ALTER_TAB_CONF, &Dbtup::execALTER_TAB_CONF);
116 m_max_parallel_index_build = 0;
119 addRecSignal(GSN_ACC_SCANREQ, &Dbtup::execACC_SCANREQ);
120 addRecSignal(GSN_NEXT_SCANREQ, &Dbtup::execNEXT_SCANREQ);
121 addRecSignal(GSN_ACC_CHECK_SCAN, &Dbtup::execACC_CHECK_SCAN);
122 addRecSignal(GSN_ACCKEYCONF, &Dbtup::execACCKEYCONF);
123 addRecSignal(GSN_ACCKEYREF, &Dbtup::execACCKEYREF);
124 addRecSignal(GSN_ACC_ABORTCONF, &Dbtup::execACC_ABORTCONF);
127 addRecSignal(GSN_FSREMOVEREF, &Dbtup::execFSREMOVEREF,
true);
128 addRecSignal(GSN_FSREMOVECONF, &Dbtup::execFSREMOVECONF,
true);
130 addRecSignal(GSN_DROP_FRAG_REQ, &Dbtup::execDROP_FRAG_REQ);
131 addRecSignal(GSN_SUB_GCP_COMPLETE_REP, &Dbtup::execSUB_GCP_COMPLETE_REP);
133 addRecSignal(GSN_FIRE_TRIG_REQ, &Dbtup::execFIRE_TRIG_REQ);
143 CLEAR_ERROR_INSERT_VALUE;
145 RSS_OP_COUNTER_INIT(cnoOfFreeFragoprec);
146 RSS_OP_COUNTER_INIT(cnoOfFreeFragrec);
147 RSS_OP_COUNTER_INIT(cnoOfFreeTabDescrRec);
148 c_storedProcCountNonAPI = 0;
151 CallbackEntry& ce = m_callbackEntry[THE_NULL_CALLBACK];
152 ce.m_function = TheNULLCallback.m_callbackFunction;
156 CallbackEntry& ce = m_callbackEntry[UNDO_CREATETABLE_LOGSYNC_CALLBACK];
157 ce.m_function = safe_cast(&Dbtup::undo_createtable_logsync_callback);
161 CallbackEntry& ce = m_callbackEntry[DROP_TABLE_LOGSYNC_CALLBACK];
162 ce.m_function = safe_cast(&Dbtup::drop_table_logsync_callback);
166 CallbackEntry& ce = m_callbackEntry[UNDO_CREATETABLE_CALLBACK];
167 ce.m_function = safe_cast(&Dbtup::undo_createtable_callback);
171 CallbackEntry& ce = m_callbackEntry[DROP_TABLE_LOG_BUFFER_CALLBACK];
172 ce.m_function = safe_cast(&Dbtup::drop_table_log_buffer_callback);
176 CallbackEntry& ce = m_callbackEntry[DROP_FRAGMENT_FREE_EXTENT_LOG_BUFFER_CALLBACK];
177 ce.m_function = safe_cast(&Dbtup::drop_fragment_free_extent_log_buffer_callback);
181 CallbackEntry& ce = m_callbackEntry[NR_DELETE_LOG_BUFFER_CALLBACK];
186 CallbackEntry& ce = m_callbackEntry[DISK_PAGE_LOG_BUFFER_CALLBACK];
187 ce.m_function = safe_cast(&Dbtup::disk_page_log_buffer_callback);
191 CallbackTable& ct = m_callbackTable;
192 ct.m_count = COUNT_CALLBACKS;
193 ct.m_entry = m_callbackEntry;
194 m_callbackTableAddr = &ct;
215 sizeof(alterTabOperRec),
227 sizeof(TableDescriptor),
232 Dbtup::Apply_undo::Apply_undo()
238 m_table_ptr.setNull();
239 m_fragment_ptr.setNull();
240 m_page_ptr.setNull();
241 m_extent_ptr.setNull();
245 BLOCK_FUNCTIONS(
Dbtup)
250 Uint32 actionType = signal->theData[0];
251 Uint32 dataPtr = signal->theData[1];
253 switch (actionType) {
254 case ZINITIALISE_RECORDS:
256 initialiseRecordsLab(signal, dataPtr,
257 signal->theData[2], signal->theData[3]);
261 releaseFragment(signal, dataPtr, signal->theData[2]);
265 buildIndex(signal, dataPtr);
271 c_scanOpPool.
getPtr(scanPtr, dataPtr);
272 scanCont(signal, scanPtr);
280 FragrecordPtr fragPtr;
281 fragPtr.i= signal->theData[2];
282 ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
283 ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
284 drop_fragment_free_extent(signal, tabPtr, fragPtr, signal->theData[3]);
292 FragrecordPtr fragPtr;
293 fragPtr.i= signal->theData[2];
294 ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
295 ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
296 drop_fragment_unmap_pages(signal, tabPtr, fragPtr, signal->theData[3]);
299 case ZFREE_VAR_PAGES:
302 drop_fragment_free_var_pages(signal);
308 drop_fragment_free_pages(signal);
311 case ZREBUILD_FREE_PAGE_LIST:
314 rebuild_page_free_list(signal);
317 case ZDISK_RESTART_UNDO:
324 Uint32
type = signal->theData[1];
325 Uint32 len = signal->theData[2];
326 Uint64 lsn_hi = signal->theData[3];
327 Uint64 lsn_lo = signal->theData[4];
328 Uint64
lsn = (lsn_hi << 32) | lsn_lo;
330 ndbrequire(handle.m_cnt == 1);
332 handle.getSection(ssptr, 0);
333 ::copy(c_proxy_undo_data, ssptr);
334 releaseSections(handle);
350 void Dbtup::execSTTOR(
Signal* signal)
353 Uint32 startPhase = signal->theData[1];
354 Uint32 sigKey = signal->theData[6];
355 switch (startPhase) {
358 ndbrequire((c_lqh= (
Dblqh*)globalData.getBlock(DBLQH, instance())) != 0);
359 ndbrequire((c_tsman= (
Tsman*)globalData.getBlock(TSMAN)) != 0);
360 ndbrequire((c_lgman= (
Lgman*)globalData.getBlock(LGMAN)) != 0);
361 ndbrequire((c_pgman= (
Pgman*)globalData.getBlock(PGMAN, instance())) != 0);
362 cownref = calcInstanceBlockRef(DBTUP);
368 signal->theData[0] = sigKey;
369 signal->theData[1] = 3;
370 signal->theData[2] = 2;
371 signal->theData[3] = ZSTARTPHASE1;
372 signal->theData[4] = 255;
373 BlockReference cntrRef = !isNdbMtLqh() ? NDBCNTR_REF : DBTUP_REF;
374 sendSignal(cntrRef, GSN_STTORRY, signal, 5, JBB);
382 void Dbtup::execREAD_CONFIG_REQ(
Signal* signal)
385 Uint32 ref = req->senderRef;
386 Uint32 senderData = req->senderData;
387 ndbrequire(req->noOfParameters == 0);
392 m_ctx.m_config.getOwnConfigIterator();
395 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_FRAG, &cnoOfFragrec));
397 Uint32 noOfTriggers= 0;
398 Uint32 noOfAttribs = 0;
400 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_TABLE, &cnoOfTablerec));
401 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_ATTRIBUTES, &noOfAttribs));
403 Uint32 noOfStoredProc;
404 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_STORED_PROC,
406 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TRIGGERS,
411 Uint32 keyDesc = noOfAttribs;
412 Uint32 maxKeyDesc = cnoOfTablerec * MAX_ATTRIBUTES_IN_INDEX;
413 if (keyDesc > maxKeyDesc)
420 keyDesc = maxKeyDesc;
424 cnoOfTablerec * 2 * (ZTD_SIZE + ZTD_TRAILER_SIZE) +
425 noOfAttribs * (sizeOfReadFunction() +
426 sizeOfReadFunction() +
427 (
sizeof(
char*) >> 2) +
433 cnoOfTabDescrRec = (cnoOfTabDescrRec & 0xFFFFFFF0) + 16;
438 c_storedProcPool.
setSize(noOfStoredProc);
441 allocCopyProcedure();
443 c_buildIndexPool.
setSize(c_noOfBuildIndexRec);
450 c_page_request_pool.wo_pool_init(RT_DBTUP_PAGE_REQUEST, pc);
451 c_extent_pool.init(RT_DBTUP_EXTENT_INFO, pc);
452 NdbMutex_Init(&c_page_map_pool_mutex);
453 c_page_map_pool.init(&c_page_map_pool_mutex, RT_DBTUP_PAGE_MAP, pc);
456 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_SCAN_OP, &nScanOp));
457 c_scanOpPool.
setSize(nScanOp + 1);
459 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_BATCH_SIZE, &nScanBatch));
460 c_scanLockPool.
setSize(nScanOp * nScanBatch);
465 Uint64 tmp = 64*1024*1024;
466 ndb_mgm_get_int64_parameter(p, CFG_DB_DISK_PAGE_BUFFER_MEMORY, &tmp);
467 tmp = (tmp + GLOBAL_PAGE_SIZE - 1) / GLOBAL_PAGE_SIZE;
470 m_max_page_read_ahead = 32;
472 m_max_page_read_ahead = (Uint32)tmp;
477 ndbrequire(c_scanOpPool.
seize(lcp));
478 new (lcp.p) ScanOp();
479 c_lcp_scan_op= lcp.i;
482 cminusOne = czero - 1;
484 clastBitMask = clastBitMask << 31;
486 ndb_mgm_get_int_parameter(p, CFG_DB_MT_BUILD_INDEX,
487 &m_max_parallel_index_build);
489 if (isNdbMtLqh() && globalData.ndbMtLqhThreads > 1)
494 Uint32 val = m_max_parallel_index_build;
495 val = (val + instance() - 1) / globalData.ndbMtLqhThreads;
496 m_max_parallel_index_build = val;
499 initialiseRecordsLab(signal, 0, ref, senderData);
502 void Dbtup::initRecords()
508 m_ctx.m_config.getOwnConfigIterator();
512 void* ptr = m_ctx.m_mm.get_memroot();
513 c_page_pool.set((Page*)ptr, (Uint32)~0);
515 fragoperrec = (Fragoperrec*)
allocRecord(
"Fragoperrec",
519 fragrecord = (Fragrecord*)
allocRecord(
"Fragrecord",
523 alterTabOperRec = (AlterTabOperation*)
allocRecord(
"AlterTabOperation",
524 sizeof(AlterTabOperation),
527 hostBuffer = (HostBuffer*)
allocRecord(
"HostBuffer",
531 tableDescriptor = (TableDescriptor*)
allocRecord(
"TableDescriptor",
532 sizeof(TableDescriptor),
535 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_OP_RECS, &tmp));
536 ndb_mgm_get_int_parameter(p, CFG_DB_NO_LOCAL_OPS, &tmp1);
537 c_operation_pool.
setSize(tmp,
false,
true,
true,
538 tmp1 == 0 ? CFG_DB_NO_OPS : CFG_DB_NO_LOCAL_OPS);
544 for (i = 0; i<cnoOfTablerec; i++) {
545 void * p = &tablerec[
i];
550 void Dbtup::initialiseRecordsLab(
Signal* signal, Uint32 switchData,
551 Uint32 retRef, Uint32 retData)
553 switch (switchData) {
556 initializeHostBuffer();
560 initializeOperationrec();
571 initializeTablerec();
578 initializeFragrecord();
582 initializeFragoperrec();
589 initializeTabDescr();
593 initializeAlterTabOperation();
609 conf->senderRef = reference();
610 conf->senderData = retData;
611 sendSignal(retRef, GSN_READ_CONFIG_CONF, signal,
612 ReadConfigConf::SignalLength, JBB);
619 signal->theData[0] = ZINITIALISE_RECORDS;
620 signal->theData[1] = switchData + 1;
621 signal->theData[2] = retRef;
622 signal->theData[3] = retData;
623 sendSignal(reference(), GSN_CONTINUEB, signal, 4, JBB);
627 void Dbtup::execNDB_STTOR(
Signal* signal)
630 cndbcntrRef = signal->theData[0];
631 Uint32 ownNodeId = signal->theData[1];
632 Uint32 startPhase = signal->theData[2];
633 switch (startPhase) {
636 cownNodeId = ownNodeId;
637 cownref = calcInstanceBlockRef(DBTUP);
638 initializeDefaultValuesFrag();
645 startphase3Lab(signal, ~0, ~0);
657 signal->theData[0] = cownref;
658 BlockReference cntrRef = !isNdbMtLqh() ? NDBCNTR_REF : DBTUP_REF;
659 sendSignal(cntrRef, GSN_NDB_STTORRY, signal, 1, JBB);
662 void Dbtup::startphase3Lab(
Signal* signal, Uint32 config1, Uint32 config2)
666 void Dbtup::initializeDefaultValuesFrag()
671 seizeFragrecord(DefaultValuesFragment);
672 DefaultValuesFragment.p->fragStatus = Fragrecord::FS_ONLINE;
673 DefaultValuesFragment.p->m_undo_complete=
false;
674 DefaultValuesFragment.p->m_lcp_scan_op = RNIL;
675 DefaultValuesFragment.p->noOfPages = 0;
676 DefaultValuesFragment.p->noOfVarPages = 0;
677 DefaultValuesFragment.p->m_max_page_no = 0;
678 DefaultValuesFragment.p->m_free_page_id_list = FREE_PAGE_RNIL;
679 ndbrequire(DefaultValuesFragment.p->m_page_map.isEmpty());
680 DefaultValuesFragment.p->m_restore_lcp_id = RNIL;
681 for (Uint32 i = 0; i<MAX_FREE_LIST+1; i++)
682 ndbrequire(DefaultValuesFragment.p->free_var_page_array[i].isEmpty());
684 DefaultValuesFragment.p->m_logfile_group_id = RNIL;
689 void Dbtup::initializeFragoperrec()
691 FragoperrecPtr fragoperPtr;
692 for (fragoperPtr.i = 0; fragoperPtr.i < cnoOfFragoprec; fragoperPtr.i++) {
693 ptrAss(fragoperPtr, fragoperrec);
694 fragoperPtr.p->nextFragoprec = fragoperPtr.i + 1;
696 fragoperPtr.i = cnoOfFragoprec - 1;
697 ptrAss(fragoperPtr, fragoperrec);
698 fragoperPtr.p->nextFragoprec = RNIL;
699 cfirstfreeFragopr = 0;
702 void Dbtup::initializeFragrecord()
704 FragrecordPtr regFragPtr;
705 for (regFragPtr.i = 0; regFragPtr.i < cnoOfFragrec; regFragPtr.i++) {
707 ptrAss(regFragPtr, fragrecord);
708 new (regFragPtr.p) Fragrecord();
709 regFragPtr.p->nextfreefrag = regFragPtr.i + 1;
710 regFragPtr.p->fragStatus = Fragrecord::FS_FREE;
712 regFragPtr.i = cnoOfFragrec - 1;
713 ptrAss(regFragPtr, fragrecord);
714 regFragPtr.p->nextfreefrag = RNIL;
718 void Dbtup::initializeAlterTabOperation()
720 AlterTabOperationPtr regAlterTabOpPtr;
721 for (regAlterTabOpPtr.i= 0;
722 regAlterTabOpPtr.i<cnoOfAlterTabOps;
723 regAlterTabOpPtr.i++)
726 ptrAss(regAlterTabOpPtr, alterTabOperRec);
727 new (regAlterTabOpPtr.p) AlterTabOperation();
728 regAlterTabOpPtr.p->nextAlterTabOp= regAlterTabOpPtr.i+1;
730 regAlterTabOpPtr.i= cnoOfAlterTabOps-1;
731 ptrAss(regAlterTabOpPtr, alterTabOperRec);
732 regAlterTabOpPtr.p->nextAlterTabOp= RNIL;
733 cfirstfreeAlterTabOp= 0;
736 void Dbtup::initializeHostBuffer()
739 cpackedListIndex = 0;
740 for (hostId = 0; hostId < MAX_NODES; hostId++) {
741 hostBuffer[hostId].inPackedList =
false;
742 hostBuffer[hostId].noOfPacketsTA = 0;
743 hostBuffer[hostId].packetLenTA = 0;
748 void Dbtup::initializeOperationrec()
753 void Dbtup::initializeTablerec()
755 TablerecPtr regTabPtr;
756 for (regTabPtr.i = 0; regTabPtr.i < cnoOfTablerec; regTabPtr.i++) {
759 ptrAss(regTabPtr, tablerec);
760 initTab(regTabPtr.p);
765 Dbtup::initTab(Tablerec*
const regTabPtr)
767 for (Uint32 i = 0; i < MAX_FRAG_PER_NODE; i++) {
768 regTabPtr->fragid[
i] = RNIL;
769 regTabPtr->fragrec[
i] = RNIL;
771 regTabPtr->readFunctionArray = NULL;
772 regTabPtr->updateFunctionArray = NULL;
773 regTabPtr->charsetArray = NULL;
775 regTabPtr->tabDescriptor = RNIL;
776 regTabPtr->readKeyArray = RNIL;
777 regTabPtr->dynTabDescriptor[MM] = RNIL;
778 regTabPtr->dynTabDescriptor[DD] = RNIL;
779 regTabPtr->dynFixSizeMask[MM] = NULL;
780 regTabPtr->dynVarSizeMask[MM] = NULL;
781 regTabPtr->dynFixSizeMask[DD] = NULL;
782 regTabPtr->dynVarSizeMask[DD] = NULL;
784 regTabPtr->m_bits = 0;
786 regTabPtr->m_no_of_attributes = 0;
787 regTabPtr->noOfKeyAttr = 0;
789 regTabPtr->m_dropTable.tabUserPtr = RNIL;
790 regTabPtr->m_dropTable.tabUserRef = 0;
791 regTabPtr->tableStatus = NOT_DEFINED;
792 regTabPtr->m_default_value_location.setNull();
795 if (!regTabPtr->afterInsertTriggers.isEmpty())
796 regTabPtr->afterInsertTriggers.release();
797 if (!regTabPtr->afterDeleteTriggers.isEmpty())
798 regTabPtr->afterDeleteTriggers.release();
799 if (!regTabPtr->afterUpdateTriggers.isEmpty())
800 regTabPtr->afterUpdateTriggers.release();
801 if (!regTabPtr->subscriptionInsertTriggers.isEmpty())
802 regTabPtr->subscriptionInsertTriggers.release();
803 if (!regTabPtr->subscriptionDeleteTriggers.isEmpty())
804 regTabPtr->subscriptionDeleteTriggers.release();
805 if (!regTabPtr->subscriptionUpdateTriggers.isEmpty())
806 regTabPtr->subscriptionUpdateTriggers.release();
807 if (!regTabPtr->constraintUpdateTriggers.isEmpty())
808 regTabPtr->constraintUpdateTriggers.release();
809 if (!regTabPtr->tuxCustomTriggers.isEmpty())
810 regTabPtr->tuxCustomTriggers.release();
813 void Dbtup::initializeTabDescr()
815 TableDescriptorPtr regTabDesPtr;
816 for (Uint32 i = 0; i < 16; i++) {
817 cfreeTdList[
i] = RNIL;
819 for (regTabDesPtr.i = 0; regTabDesPtr.i < cnoOfTabDescrRec; regTabDesPtr.i++) {
821 ptrAss(regTabDesPtr, tableDescriptor);
822 regTabDesPtr.p->tabDescr = RNIL;
824 freeTabDescr(0, cnoOfTabDescrRec);
832 void Dbtup::execTUPSEIZEREQ(
Signal* signal)
834 OperationrecPtr regOperPtr;
836 Uint32 userPtr = signal->theData[0];
837 BlockReference userRef = signal->theData[1];
838 if (!c_operation_pool.
seize(regOperPtr))
841 signal->theData[0] = userPtr;
842 signal->theData[1] = ZGET_OPREC_ERROR;
843 sendSignal(userRef, GSN_TUPSEIZEREF, signal, 2, JBB);
847 new (regOperPtr.p) Operationrec();
848 regOperPtr.p->m_any_value = 0;
849 regOperPtr.p->op_struct.op_type = ZREAD;
850 regOperPtr.p->op_struct.in_active_list =
false;
851 set_trans_state(regOperPtr.p, TRANS_DISCONNECTED);
852 regOperPtr.p->prevActiveOp = RNIL;
853 regOperPtr.p->nextActiveOp = RNIL;
854 regOperPtr.p->tupVersion = ZNIL;
855 regOperPtr.p->op_struct.delete_insert_flag =
false;
857 initOpConnection(regOperPtr.p);
858 regOperPtr.p->userpointer = userPtr;
859 signal->theData[0] = regOperPtr.p->userpointer;
860 signal->theData[1] = regOperPtr.i;
861 sendSignal(userRef, GSN_TUPSEIZECONF, signal, 2, JBB);
865 #define printFragment(t){ for(Uint32 i = 0; i < MAX_FRAG_PER_NODE;i++){\
866 ndbout_c("table = %d fragid[%d] = %d fragrec[%d] = %d", \
867 t.i, t.p->fragid[i], i, t.p->fragrec[i]); }}
869 void Dbtup::execTUPRELEASEREQ(
Signal* signal)
871 OperationrecPtr regOperPtr;
873 regOperPtr.i = signal->theData[0];
874 c_operation_pool.
getPtr(regOperPtr);
875 set_trans_state(regOperPtr.p, TRANS_DISCONNECTED);
876 c_operation_pool.
release(regOperPtr);
878 signal->theData[0] = regOperPtr.p->userpointer;
879 sendSignal(DBLQH_REF, GSN_TUPRELEASECONF, signal, 1, JBB);
883 void Dbtup::releaseFragrec(FragrecordPtr regFragPtr)
885 regFragPtr.p->nextfreefrag = cfirstfreefrag;
886 cfirstfreefrag = regFragPtr.i;
887 RSS_OP_FREE(cnoOfFreeFragrec);
891 void Dbtup::execNODE_FAILREP(
Signal* signal)
896 failed.
assign(NdbNodeBitmask::Size, rep->theNodes);
899 for(
unsigned i = 1; i < MAX_NDB_NODES; i++) {
904 ndbassert(elementsCleaned == 0);
905 (void) elementsCleaned;