22 #include <SimulatedBlock.hpp>
23 #include <ndb_limits.h>
24 #include <trigger_definitions.h>
25 #include <AttributeHeader.hpp>
26 #include <Bitmask.hpp>
27 #include <signaldata/TupKey.hpp>
28 #include <signaldata/CreateTrig.hpp>
29 #include <signaldata/CreateTrigImpl.hpp>
30 #include <signaldata/DropTrig.hpp>
31 #include <signaldata/DropTrigImpl.hpp>
32 #include <signaldata/TrigAttrInfo.hpp>
33 #include <signaldata/BuildIndxImpl.hpp>
34 #include <signaldata/AlterTab.hpp>
35 #include <AttributeDescriptor.hpp>
36 #include "AttributeOffset.hpp"
37 #include "Undo_buffer.hpp"
38 #include "tuppage.hpp"
39 #include <DynArr256.hpp>
40 #include "../pgman.hpp"
41 #include "../tsman.hpp"
46 #ifdef DBTUP_BUFFER_CPP
47 #define jam() jamLine(10000 + __LINE__)
48 #define jamEntry() jamEntryLine(10000 + __LINE__)
50 #ifdef DBTUP_ROUTINES_CPP
51 #define jam() jamLine(15000 + __LINE__)
52 #define jamEntry() jamEntryLine(15000 + __LINE__)
54 #ifdef DBTUP_COMMIT_CPP
55 #define jam() jamLine(20000 + __LINE__)
56 #define jamEntry() jamEntryLine(20000 + __LINE__)
58 #ifdef DBTUP_FIXALLOC_CPP
59 #define jam() jamLine(25000 + __LINE__)
60 #define jamEntry() jamEntryLine(25000 + __LINE__)
62 #ifdef DBTUP_TRIGGER_CPP
63 #define jam() jamLine(30000 + __LINE__)
64 #define jamEntry() jamEntryLine(30000 + __LINE__)
66 #ifdef DBTUP_ABORT_CPP
67 #define jam() jamLine(35000 + __LINE__)
68 #define jamEntry() jamEntryLine(35000 + __LINE__)
70 #ifdef DBTUP_PAGE_MAP_CPP
71 #define jam() jamLine(40000 + __LINE__)
72 #define jamEntry() jamEntryLine(40000 + __LINE__)
74 #ifdef DBTUP_PAG_MAN_CPP
75 #define jam() jamLine(45000 + __LINE__)
76 #define jamEntry() jamEntryLine(45000 + __LINE__)
78 #ifdef DBTUP_STORE_PROC_DEF_CPP
79 #define jam() jamLine(50000 + __LINE__)
80 #define jamEntry() jamEntryLine(50000 + __LINE__)
83 #define jam() jamLine(55000 + __LINE__)
84 #define jamEntry() jamEntryLine(55000 + __LINE__)
86 #ifdef DBTUP_TAB_DES_MAN_CPP
87 #define jam() jamLine(60000 + __LINE__)
88 #define jamEntry() jamEntryLine(60000 + __LINE__)
91 #define jam() jamLine(65000 + __LINE__)
92 #define jamEntry() jamEntryLine(65000 + __LINE__)
94 #ifdef DBTUP_INDEX_CPP
95 #define jam() jamLine(70000 + __LINE__)
96 #define jamEntry() jamEntryLine(70000 + __LINE__)
98 #ifdef DBTUP_DEBUG_CPP
99 #define jam() jamLine(75000 + __LINE__)
100 #define jamEntry() jamEntryLine(75000 + __LINE__)
102 #ifdef DBTUP_VAR_ALLOC_CPP
103 #define jam() jamLine(80000 + __LINE__)
104 #define jamEntry() jamEntryLine(80000 + __LINE__)
106 #ifdef DBTUP_SCAN_CPP
107 #define jam() jamLine(85000 + __LINE__)
108 #define jamEntry() jamEntryLine(85000 + __LINE__)
110 #ifdef DBTUP_DISK_ALLOC_CPP
111 #define jam() jamLine(90000 + __LINE__)
112 #define jamEntry() jamEntryLine(90000 + __LINE__)
115 #define jam() jamLine(__LINE__)
116 #define jamEntry() jamEntryLine(__LINE__)
121 static int i=0;
static char buf[5][200];
122 bm.
getText(buf[i%5]);
return buf[i++%5]; }
123 inline const char* dbgmask(
const Uint32 bm[2]) {
124 static int i=0;
static char buf[5][200];
125 sprintf(buf[i%5],
"%08x%08x",bm[1],bm[0]);
return buf[i++%5]; }
128 #define ZWORDS_ON_PAGE 8192
129 #define ZMIN_PAGE_LIMIT_TUPKEYREQ 5
130 #define ZTUP_VERSION_BITS 15
131 #define ZTUP_VERSION_MASK ((1 << ZTUP_VERSION_BITS) - 1)
132 #define MAX_FREE_LIST 4
134 inline Uint32* ALIGN_WORD(
void * ptr)
136 return (Uint32*)(((UintPtr(ptr) + 3) >> 2) << 2);
139 inline const Uint32* ALIGN_WORD(
const void* ptr)
141 return (Uint32*)(((UintPtr(ptr) + 3) >> 2) << 2);
182 #define ZNO_OF_CONCURRENT_OPEN_OP 40
183 #define ZNO_OF_CONCURRENT_WRITE_OP 80
184 #define ZNO_OF_FRAGOPREC 20
185 #define TOT_PAGE_RECORD_SPACE 262144
186 #define ZNO_OF_PAGE TOT_PAGE_RECORD_SPACE/ZWORDS_ON_PAGE
187 #define ZNO_OF_PAGE_RANGE_REC 128
189 #define ZDEFAULT_MAX_NO_TRIGGERS_PER_TABLE 16
200 #define ZINSERT_DELETE 0
201 #define ZUPDATE_ALL 8
224 #define ZGET_OPREC_ERROR 804 // TUP_SEIZEREF
226 #define ZEXIST_FRAG_ERROR 816 // Add fragment
227 #define ZFULL_FRAGRECORD_ERROR 817 // Add fragment
228 #define ZNO_FREE_PAGE_RANGE_ERROR 818 // Add fragment
229 #define ZNOFREE_FRAGOP_ERROR 830 // Add fragment
230 #define ZTOO_LARGE_TUPLE_ERROR 851 // Add fragment
231 #define ZNO_FREE_TAB_ENTRY_ERROR 852 // Add fragment
232 #define ZNO_PAGES_ALLOCATED_ERROR 881 // Add fragment
234 #define ZGET_REALPID_ERROR 809
235 #define ZNOT_IMPLEMENTED_ERROR 812
236 #define ZSEIZE_ATTRINBUFREC_ERROR 805
237 #define ZTOO_MUCH_ATTRINFO_ERROR 823
238 #define ZMEM_NOTABDESCR_ERROR 826
239 #define ZMEM_NOMEM_ERROR 827
240 #define ZAI_INCONSISTENCY_ERROR 829
241 #define ZNO_ILLEGAL_NULL_ATTR 839
242 #define ZNOT_NULL_ATTR 840
243 #define ZBAD_DEFAULT_VALUE_LEN 850
244 #define ZNO_INSTRUCTION_ERROR 871
245 #define ZOUTSIDE_OF_PROGRAM_ERROR 876
246 #define ZSTORED_PROC_ID_ERROR 877
247 #define ZREGISTER_INIT_ERROR 878
248 #define ZATTRIBUTE_ID_ERROR 879
249 #define ZTRY_TO_READ_TOO_MUCH_ERROR 880
250 #define ZTOTAL_LEN_ERROR 882
251 #define ZATTR_INTERPRETER_ERROR 883
252 #define ZSTACK_OVERFLOW_ERROR 884
253 #define ZSTACK_UNDERFLOW_ERROR 885
254 #define ZTOO_MANY_INSTRUCTIONS_ERROR 886
255 #define ZTRY_TO_UPDATE_ERROR 888
256 #define ZCALL_ERROR 890
257 #define ZTEMPORARY_RESOURCE_FAILURE 891
258 #define ZUNSUPPORTED_BRANCH 892
260 #define ZSTORED_SEIZE_ATTRINBUFREC_ERROR 873 // Part of Scan
261 #define ZSTORED_TOO_MUCH_ATTRINFO_ERROR 874
263 #define ZREAD_ONLY_CONSTRAINT_VIOLATION 893
264 #define ZVAR_SIZED_NOT_SUPPORTED 894
265 #define ZINCONSISTENT_NULL_ATTRIBUTE_COUNT 895
266 #define ZTUPLE_CORRUPTED_ERROR 896
267 #define ZTRY_UPDATE_PRIMARY_KEY 897
268 #define ZMUST_BE_ABORTED_ERROR 898
269 #define ZTUPLE_DELETED_ERROR 626
270 #define ZINSERT_ERROR 630
271 #define ZOP_AFTER_REFRESH_ERROR 920
273 #define ZINVALID_CHAR_FORMAT 744
274 #define ZROWID_ALLOCATED 899
275 #define ZINVALID_ALTER_TAB 741
277 #define ZTOO_MANY_BITS_ERROR 791
281 #define ZTH_MM_FREE 3
282 #define ZTH_MM_FULL 4
285 #define ZTD_DATASIZE 1
289 #define ZTD_TR_SIZE 1
290 #define ZTD_TR_TYPE 2
291 #define ZTD_TRAILER_SIZE 2
293 #define ZAD_LOG_SIZE 1
296 #define ZTD_FL_HEADER 0
297 #define ZTD_FL_SIZE 1
298 #define ZTD_FL_PREV 2
299 #define ZTD_FL_NEXT 3
300 #define ZTD_FREE_SIZE 16
303 #define ZTD_TYPE_FREE 0
304 #define ZTD_TYPE_NORMAL 1
311 #define ZSTARTPHASE1 1
312 #define ZSTARTPHASE2 2
313 #define ZSTARTPHASE3 3
314 #define ZSTARTPHASE4 4
315 #define ZSTARTPHASE6 6
322 #define ZINITIALISE_RECORDS 6
324 #define ZREPORT_MEMORY_USAGE 8
325 #define ZBUILD_INDEX 9
327 #define ZFREE_EXTENT 11
328 #define ZUNMAP_PAGES 12
329 #define ZFREE_VAR_PAGES 13
330 #define ZFREE_PAGES 14
331 #define ZREBUILD_FREE_PAGE_LIST 15
332 #define ZDISK_RESTART_UNDO 16
334 #define ZSCAN_PROCEDURE 0
335 #define ZCOPY_PROCEDURE 2
336 #define ZSTORED_PROCEDURE_DELETE 3
337 #define ZSTORED_PROCEDURE_FREE 0xffff
338 #define ZMIN_PAGE_LIMIT_TUP_COMMITREQ 2
340 #define ZSKIP_TUX_TRIGGERS 0x1 // flag for TUP_ABORTREQ
350 typedef bool (
Dbtup::* ReadFunction)(Uint8*,
354 typedef bool (
Dbtup::* UpdateFunction)(Uint32*,
372 UNDO_CREATETABLE_LOGSYNC_CALLBACK = 1,
373 DROP_TABLE_LOGSYNC_CALLBACK = 2,
374 UNDO_CREATETABLE_CALLBACK = 3,
375 DROP_TABLE_LOG_BUFFER_CALLBACK = 4,
376 DROP_FRAGMENT_FREE_EXTENT_LOG_BUFFER_CALLBACK = 5,
377 NR_DELETE_LOG_BUFFER_CALLBACK = 6,
378 DISK_PAGE_LOG_BUFFER_CALLBACK = 7,
387 TRANS_NOT_USED_STATE = 2,
388 TRANS_ERROR_WAIT_STORED_PROCREQ = 3,
389 TRANS_ERROR_WAIT_TUPKEYREQ = 4,
390 TRANS_TOO_MUCH_AI = 5,
391 TRANS_DISCONNECTED = 6
396 TUPLE_ALREADY_ABORTED = 2,
397 TUPLE_TO_BE_COMMITTED = 3
416 Uint32 nextFragoprec;
421 Uint32 attributeCount;
423 Uint32 m_null_bits[2];
424 Uint32 m_extra_row_gci_bits;
425 Uint32 m_extra_row_author_bits;
427 BlockReference lqhBlockrefFrag;
432 bool definingFragment;
439 Uint32 nextAlterTabOp;
441 Uint32 newNoOfCharsets;
442 Uint32 newNoOfKeyAttrs;
443 Uint32 noOfDynNullBits;
447 Uint32 tabDesOffset[7];
448 Uint32 tableDescriptor;
449 Uint32 dynTabDesOffset[3];
450 Uint32 dynTableDescriptor;
475 Uint32 m_extent_info_ptr_i;
507 m_fragId(~(Uint32)0),
534 SCAN_LOCK_WAIT = 0x40,
536 SCAN_LOCK = SCAN_LOCK_SH | SCAN_LOCK_EX,
549 Uint32 m_savePointId;
573 void disk_page_tup_scan_callback(
Signal*, Uint32 scanPtrI, Uint32 page_i);
575 void addAccLockOp(
ScanOp& scan, Uint32 accLockOp);
576 void removeAccLockOp(
ScanOp& scan, Uint32 accLockOp);
580 Uint64 c_dataBuffer[ZWORDS_ON_PAGE/2 + 1];
587 Uint32 m_extent_info_ptr;
588 Uint16 m_original_estimated_free_space;
591 Uint16 m_uncommitted_used_space;
601 STATIC_CONST( EXTENT_SEARCH_MATRIX_COLS = 4 );
602 STATIC_CONST( EXTENT_SEARCH_MATRIX_ROWS = 5 );
603 STATIC_CONST( EXTENT_SEARCH_MATRIX_SIZE = 20 );
613 Uint32 m_first_page_no;
614 Uint32 m_empty_page_no;
617 Uint32 m_free_matrix_pos;
618 Uint16 m_free_page_count[EXTENT_SEARCH_MATRIX_COLS];
624 Uint32 nextHash, prevHash;
626 Uint32 hashValue()
const {
627 return (m_key.m_file_no << 16) ^ m_key.m_page_idx;
632 return m_key.m_file_no == rec.m_key.m_file_no &&
633 m_key.m_page_idx == rec.m_key.m_page_idx;
648 Uint32 extent_size_in_pages);
649 Uint32 m_extent_size;
688 STATIC_CONST( SZ = EXTENT_SEARCH_MATRIX_SIZE );
690 Uint32 m_total_extent_free_space_thresholds[EXTENT_SEARCH_MATRIX_ROWS];
691 Uint32 m_page_free_bits_map[EXTENT_SEARCH_MATRIX_COLS];
700 return m_page_free_bits_map[bits];
707 for(Uint32 i = 0; i<EXTENT_SEARCH_MATRIX_COLS-1; i++)
708 if(free >= m_page_free_bits_map[i])
710 return EXTENT_SEARCH_MATRIX_COLS - 1;
716 void dump_disk_alloc(Disk_alloc_info&);
718 STATIC_CONST( FREE_PAGE_BIT = 0x80000000 );
719 STATIC_CONST( FREE_PAGE_RNIL = RNIL + 1 );
725 Uint32 m_max_page_no;
726 Uint32 m_free_page_id_list;
730 Uint32 m_lcp_scan_op;
741 ,FS_REORG_COMPLETE_NEW
751 enum { UC_LCP = 1, UC_CREATE = 2, UC_SET_LCP = 3 };
752 Uint32 m_restore_lcp_id;
753 Uint32 m_undo_complete;
754 Uint32 m_tablespace_id;
755 Uint32 m_logfile_group_id;
771 bool is_first_operation()
const {
return prevActiveOp == RNIL;}
772 bool is_last_operation()
const {
return nextActiveOp == RNIL;}
774 Uint32 m_undo_buffer_space;
808 Uint32 m_commit_disk_callback_page;
822 unsigned int trans_state : 3;
823 unsigned int tuple_state : 2;
824 unsigned int in_active_list : 1;
826 unsigned int op_type : 3;
827 unsigned int delete_insert_flag : 1;
828 unsigned int primary_replica : 1;
829 unsigned int m_reorg : 2;
830 unsigned int m_disk_preallocated : 1;
831 unsigned int m_load_diskpage_on_commit : 1;
832 unsigned int m_wait_log_buffer : 1;
833 unsigned int m_gci_written : 1;
837 Uint32 op_bit_fields;
855 RF_SINGLE_NOT_EXIST = 1,
857 RF_MULTI_NOT_EXIST = 3,
897 TriggerActionTime::Value triggerActionTime;
945 inline void print(NdbOut & s)
const { s <<
"[TriggerData = " <<
triggerId <<
"]"; };
960 STATIC_CONST( MM = 0 );
961 STATIC_CONST( DD = 1 );
962 STATIC_CONST( DYN_BM_LEN_BITS = 8 );
963 STATIC_CONST( DYN_BM_LEN_MASK = ((1 << DYN_BM_LEN_BITS) - 1));
970 STATIC_CONST( NO_DYNAMICS = 2 );
974 afterInsertTriggers(triggerPool),
975 afterDeleteTriggers(triggerPool),
976 afterUpdateTriggers(triggerPool),
977 subscriptionInsertTriggers(triggerPool),
978 subscriptionDeleteTriggers(triggerPool),
979 subscriptionUpdateTriggers(triggerPool),
980 constraintUpdateTriggers(triggerPool),
981 deferredInsertTriggers(triggerPool),
982 deferredUpdateTriggers(triggerPool),
983 deferredDeleteTriggers(triggerPool),
984 tuxCustomTriggers(triggerPool)
996 Uint32 dynTabDescriptor[2];
999 Uint32* dynVarSizeMask[2];
1005 Uint32* dynFixSizeMask[2];
1007 ReadFunction* readFunctionArray;
1008 UpdateFunction* updateFunctionArray;
1011 Uint32 readKeyArray;
1019 Uint32 tabDescriptor;
1032 Uint32 m_real_order_descriptor;
1038 TR_ForceVarPart = 0x4,
1040 TR_ExtraRowGCIBits = 0x10,
1041 TR_ExtraRowAuthorBits = 0x20
1044 Uint16 total_rec_size;
1050 Uint16 m_no_of_disk_attributes;
1052 Uint16 noOfCharsets;
1053 Uint16 m_dyn_null_bits[2];
1054 Uint16 m_no_of_extra_columns;
1056 bool need_expand()
const {
1060 bool need_expand(
bool disk)
const {
1061 return m_attributes[MM].m_no_of_varsize > 0 ||
1062 m_attributes[MM].m_no_of_dynamic > 0 ||
1063 (disk && m_no_of_disk_attributes > 0);
1066 bool need_shrink()
const {
1068 m_attributes[MM].m_no_of_varsize > 0 ||
1069 m_attributes[MM].m_no_of_dynamic > 0 ||
1070 m_attributes[DD].m_no_of_varsize > 0;
1073 bool need_shrink(
bool disk)
const {
1075 m_attributes[MM].m_no_of_varsize > 0 ||
1076 m_attributes[MM].m_no_of_dynamic > 0 ||
1077 (disk && m_attributes[DD].m_no_of_varsize > 0);
1080 template <U
int32 bit> Uint32 getExtraAttrId()
const {
1081 if (bit == TR_ExtraRowGCIBits)
1084 if (m_bits & TR_ExtraRowGCIBits)
1086 assert(bit == TR_ExtraRowAuthorBits);
1096 Uint8 m_null_offset;
1097 Uint16 m_disk_ref_offset;
1098 Uint16 m_fix_header_size;
1099 Uint16 m_max_var_offset;
1100 Uint16 m_max_dyn_offset;
1101 Uint16 m_dyn_null_words;
1104 Uint32 get_check_offset(Uint32 mm)
const {
1105 return m_offsets[mm].m_fix_header_size;
1109 Uint16 m_no_of_fixsize;
1110 Uint16 m_no_of_varsize;
1111 Uint16 m_no_of_dynamic;
1112 Uint16 m_no_of_dyn_fix;
1113 Uint16 m_no_of_dyn_var;
1135 Uint32 fragid[MAX_FRAG_PER_NODE];
1136 Uint32 fragrec[MAX_FRAG_PER_NODE];
1146 Uint32 m_fragOpPtrI;
1147 Uint32 defValSectionI;
1152 } m_reorg_suma_filter;
1163 STATIC_CONST(InternalMaxDynFix= 16);
1169 UNDO_ALLOC = File_formats::Undofile::UNDO_TUP_ALLOC
1170 ,UNDO_UPDATE = File_formats::Undofile::UNDO_TUP_UPDATE
1171 ,UNDO_FREE = File_formats::Undofile::UNDO_TUP_FREE
1172 ,UNDO_CREATE = File_formats::Undofile::UNDO_TUP_CREATE
1173 ,UNDO_DROP = File_formats::Undofile::UNDO_TUP_DROP
1174 ,UNDO_ALLOC_EXTENT = File_formats::Undofile::UNDO_TUP_ALLOC_EXTENT
1175 ,UNDO_FREE_EXTENT = File_formats::Undofile::UNDO_TUP_FREE_EXTENT
1180 Uint32 m_file_no_page_idx;
1182 Uint32 m_type_length;
1187 Uint32 m_file_no_page_idx;
1191 Uint32 m_type_length;
1196 Uint32 m_file_no_page_idx;
1200 Uint32 m_type_length;
1206 Uint32 m_type_length;
1212 Uint32 m_type_length;
1221 Uint32 m_type_length;
1230 Uint32 m_type_length;
1241 Uint32 storedProcIVal;
1249 RSS_AP_SNAPSHOT(c_storedProcPool);
1250 Uint32 c_storedProcCountNonAPI;
1251 void storedProcCountNonAPI(BlockReference apiBlockref,
int add_del);
1356 Uint32 noOfPacketsTA;
1357 Uint32 packetBufferTA[30];
1374 Uint32 m_outstanding;
1375 BuildIndxImplRef::ErrorCode m_errorCode;
1385 Uint32 c_noOfBuildIndexRec;
1387 int mt_scan_init(Uint32 tableId, Uint32 fragId,
Local_key * pos, Uint32 * fragPtrI);
1388 int mt_scan_next(Uint32 tableId, Uint32 fragPtrI,
Local_key* pos,
bool moveNext);
1395 #ifdef NDB_32BIT_VAR_REF
1402 STATIC_CONST( SZ32 = 1 );
1405 dst->m_page_no = Local_key::ref2page_id(m_ref);
1406 dst->m_page_idx = Local_key::ref2page_idx(m_ref);
1410 m_ref = Local_key::ref(src->m_page_no, src->m_page_idx);
1415 STATIC_CONST( SZ32 = 2 );
1418 dst->m_page_no = m_page_no;
1419 dst->m_page_idx = m_page_idx;
1423 m_page_no = src->m_page_no;
1424 m_page_idx = src->m_page_idx;
1431 STATIC_CONST( SZ32 = 2 );
1443 Uint32 m_base_record_ref;
1445 Uint32 m_header_bits;
1449 Uint32 m_null_bits[1];
1452 STATIC_CONST( HeaderSize = 2 );
1465 STATIC_CONST( TUP_VERSION_MASK = 0xFFFF );
1466 STATIC_CONST( COPY_TUPLE = 0x00010000 );
1467 STATIC_CONST( DISK_PART = 0x00020000 );
1468 STATIC_CONST( DISK_ALLOC = 0x00040000 );
1469 STATIC_CONST( DISK_INLINE = 0x00080000 );
1470 STATIC_CONST( ALLOC = 0x00100000 );
1471 STATIC_CONST( MM_SHRINK = 0x00200000 );
1472 STATIC_CONST( MM_GROWN = 0x00400000 );
1473 STATIC_CONST( FREED = 0x00800000 );
1474 STATIC_CONST( FREE = 0x00800000 );
1475 STATIC_CONST( LCP_SKIP = 0x01000000 );
1476 STATIC_CONST( VAR_PART = 0x04000000 );
1477 STATIC_CONST( REORG_MOVE = 0x08000000 );
1480 Uint32 get_tuple_version()
const {
1481 return m_header_bits & TUP_VERSION_MASK;
1483 void set_tuple_version(Uint32 version) {
1485 (m_header_bits & ~(Uint32)TUP_VERSION_MASK) |
1486 (version & TUP_VERSION_MASK);
1489 Uint32* get_null_bits(
const Tablerec* tabPtrP) {
1490 return m_null_bits+tabPtrP->m_offsets[MM].m_null_offset;
1493 Uint32* get_null_bits(
const Tablerec* tabPtrP, Uint32 mm) {
1494 return m_null_bits+tabPtrP->m_offsets[mm].m_null_offset;
1497 Var_part_ref* get_var_part_ref_ptr(
const Tablerec* tabPtrP) {
1498 return (Var_part_ref*)(get_disk_ref_ptr(tabPtrP) + Disk_part_ref::SZ32);
1501 const Var_part_ref* get_var_part_ref_ptr(
const Tablerec* tabPtrP)
const {
1502 return (Var_part_ref*)(get_disk_ref_ptr(tabPtrP) + Disk_part_ref::SZ32);
1505 Uint32* get_end_of_fix_part_ptr(
const Tablerec* tabPtrP) {
1506 return m_data + tabPtrP->m_offsets[MM].m_fix_header_size -
1507 Tuple_header::HeaderSize;
1510 const Uint32* get_end_of_fix_part_ptr(
const Tablerec* tabPtrP)
const {
1511 return m_data + tabPtrP->m_offsets[MM].m_fix_header_size -
1512 Tuple_header::HeaderSize;
1515 Uint32* get_disk_ref_ptr(
const Tablerec* tabPtrP) {
1516 return m_data + tabPtrP->m_offsets[MM].m_disk_ref_offset;
1519 const Uint32* get_disk_ref_ptr(
const Tablerec* tabPtrP)
const {
1520 return m_data + tabPtrP->m_offsets[MM].m_disk_ref_offset;
1523 Uint32 *get_mm_gci(
const Tablerec* tabPtrP){
1524 assert(tabPtrP->m_bits & Tablerec::TR_RowGCI);
1525 return m_data + (tabPtrP->m_bits & Tablerec::TR_Checksum);
1528 Uint32 *get_dd_gci(
const Tablerec* tabPtrP, Uint32 mm){
1529 assert(tabPtrP->m_bits & Tablerec::TR_RowGCI);
1542 STATIC_CONST( SZ32 = 1 );
1549 KRS_PRE_COMMIT0 = 2,
1556 #if defined VM_TRACE || defined ERROR_INSERT
1557 memset(
this, 0xf3,
sizeof(*
this));
1559 jamBuffer = _jamBuffer;
1561 m_deferred_constraints =
true;
1564 #if defined VM_TRACE || defined ERROR_INSERT
1565 memset(
this, 0xf3,
sizeof(*
this));
1567 jamBuffer = tup->jamBuffer();
1569 m_deferred_constraints =
true;
1596 Uint32 check_offset[2];
1600 Uint32 out_buf_index;
1601 Uint32 out_buf_bits;
1602 Uint32 in_buf_index;
1605 Uint32 m_lcp_varpart_len;
1608 Uint32 attr_descriptor;
1626 Uint16 *m_offset_array_ptr;
1627 Uint16 m_var_len_offset;
1628 Uint16 m_max_var_offset;
1629 Uint16 m_max_dyn_offset;
1634 char *m_dyn_data_ptr;
1636 Uint32 m_dyn_part_len;
1642 Uint16 *m_dyn_offset_arr_ptr;
1649 Uint16 m_dyn_len_offset;
1657 Uint32 optimize_options;
1660 bool interpreted_exec;
1664 bool m_deferred_constraints;
1667 Uint32 no_fired_triggers;
1668 Uint32 frag_page_id;
1674 Uint32 attrinfo_len;
1675 Uint32 tc_operation_ptr;
1680 BlockReference TC_ref;
1681 BlockReference rec_blockref;
1688 Uint16 var_pos_array[2*MAX_ATTRIBUTES_IN_TABLE + 1];
1720 const Uint32 * end_of_mask()
const {
return end_of_mask(m_cols); }
1721 const Uint32 * end_of_mask(Uint32 cols)
const {
1722 return m_mask + ((cols + 31) >> 5);
1725 Uint32 * end_of_mask() {
return end_of_mask(m_cols); }
1726 Uint32 * end_of_mask(Uint32 cols) {
1727 return m_mask + ((cols + 31) >> 5);
1741 void tuxGetTupAddr(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset,
1742 Uint32& lkey1, Uint32& lkey2);
1748 int tuxAllocNode(
EmulatedJamBuffer*, Uint32 fragPtrI, Uint32& pageId, Uint32& pageOffset, Uint32*& node);
1749 void tuxFreeNode(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* node);
1750 void tuxGetNode(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32*& node);
1761 Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tupVersion,
1762 const Uint32* attrIds, Uint32 numAttrs, Uint32* dataOut,
bool xfrmFlag);
1769 int tuxReadPk(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* dataOut,
bool xfrmFlag);
1776 int accReadPk(Uint32 tableId, Uint32 fragId, Uint32 fragPageId, Uint32 pageIndex, Uint32* dataOut,
bool xfrmFlag);
1781 bool tuxQueryTh(Uint32 fragPtrI, Uint32 pageId, Uint32 pageIndex, Uint32 tupVersion, Uint32 transId1, Uint32 transId2,
bool dirty, Uint32 savepointId);
1783 int load_diskpage(
Signal*, Uint32 opRec, Uint32 fragPtrI,
1784 Uint32 lkey1, Uint32 lkey2, Uint32
flags);
1786 int load_diskpage_scan(
Signal*, Uint32 opRec, Uint32 fragPtrI,
1787 Uint32 lkey1, Uint32 lkey2, Uint32
flags);
1789 void start_restore_lcp(Uint32 tableId, Uint32 fragmentId);
1791 Uint32 tableId, Uint32 fragmentId);
1792 Uint32 get_max_lcp_record_size(Uint32 tableId);
1794 int nr_read_pk(Uint32 fragPtr,
const Local_key*, Uint32* dataOut,
bool©);
1795 int nr_update_gci(Uint32 fragPtr,
const Local_key*, Uint32 gci);
1798 void nr_delete_page_callback(
Signal*, Uint32 op, Uint32
page);
1801 bool get_frag_info(Uint32 tableId, Uint32 fragId, Uint32* maxPage);
1803 BLOCK_DEFINES(
Dbtup);
1806 void execDEBUG_SIG(
Signal* signal);
1807 void execCONTINUEB(
Signal* signal);
1810 void execLCP_FRAG_ORD(
Signal*signal);
1811 void execDUMP_STATE_ORD(
Signal* signal);
1812 void execSEND_PACKED(
Signal* signal);
1813 void execSTTOR(
Signal* signal);
1814 void execTUP_LCPREQ(
Signal* signal);
1815 void execEND_LCPREQ(
Signal* signal);
1816 void execSTART_RECREQ(
Signal* signal);
1817 void execMEMCHECKREQ(
Signal* signal);
1818 void execTUPSEIZEREQ(
Signal* signal);
1819 void execTUPRELEASEREQ(
Signal* signal);
1820 void execSTORED_PROCREQ(
Signal* signal);
1822 void execCREATE_TAB_REQ(
Signal*);
1823 void execTUP_ADD_ATTRREQ(
Signal* signal);
1824 void execTUPFRAGREQ(
Signal* signal);
1825 void execTUP_COMMITREQ(
Signal* signal);
1826 void execTUP_ABORTREQ(
Signal* signal);
1827 void execNDB_STTOR(
Signal* signal);
1828 void execREAD_CONFIG_REQ(
Signal* signal);
1829 void execDROP_TAB_REQ(
Signal* signal);
1830 void execALTER_TAB_REQ(
Signal* signal);
1831 void execTUP_DEALLOCREQ(
Signal* signal);
1832 void execTUP_WRITELOG_REQ(
Signal* signal);
1833 void execNODE_FAILREP(
Signal* signal);
1835 void execDROP_FRAG_REQ(
Signal*);
1838 void execBUILD_INDX_IMPL_REQ(
Signal* signal);
1839 void execBUILD_INDX_IMPL_REF(
Signal* signal);
1840 void execBUILD_INDX_IMPL_CONF(
Signal* signal);
1841 void buildIndex(
Signal* signal, Uint32 buildPtrI);
1843 void buildIndexOffline(
Signal* signal, Uint32 buildPtrI);
1844 void buildIndexOffline_table_readonly(
Signal* signal, Uint32 buildPtrI);
1845 void execALTER_TAB_CONF(
Signal*);
1848 void execACC_SCANREQ(
Signal* signal);
1849 void execNEXT_SCANREQ(
Signal* signal);
1850 void execACC_CHECK_SCAN(
Signal* signal);
1851 void execACCKEYCONF(
Signal* signal);
1852 void execACCKEYREF(
Signal* signal);
1853 void execACC_ABORTCONF(
Signal* signal);
1857 void execFSREMOVEREF(
Signal*);
1858 void execFSREMOVECONF(
Signal*);
1860 void execDBINFO_SCANREQ(
Signal*);
1861 void execSUB_GCP_COMPLETE_REP(
Signal*);
2039 void execTUPKEYREQ(
Signal* signal);
2040 void disk_page_load_callback(
Signal*, Uint32 op, Uint32
page);
2041 void disk_page_load_scan_callback(
Signal*, Uint32 op, Uint32
page);
2048 void execCREATE_TRIG_IMPL_REQ(
Signal* signal);
2052 void execDROP_TRIG_IMPL_REQ(
Signal* signal);
2058 void execFIRE_TRIG_REQ(
Signal* signal);
2065 int handleReadReq(
Signal* signal,
2072 int handleUpdateReq(
Signal* signal,
2081 int handleInsertReq(
Signal* signal,
2090 int handleDeleteReq(
Signal* signal,
2097 int handleRefreshReq(
Signal* signal,
2106 int updateStartLab(
Signal* signal,
2118 int interpreterStartLab(
Signal* signal,
2123 Uint32 brancher(Uint32, Uint32);
2124 int interpreterNextLab(
Signal* signal,
2127 Uint32* mainProgram,
2128 Uint32 TmainProgLen,
2129 Uint32* subroutineProg,
2130 Uint32 TsubroutineLen,
2134 const Uint32 * lookupInterpreterParameter(Uint32 paramNo,
2135 const Uint32 * subptr,
2136 Uint32 sublen)
const;
2143 void sendReadAttrinfo(
Signal* signal,
2150 int sendLogAttrinfo(
Signal* signal,
2157 void sendTUPKEYCONF(
Signal* signal,
2170 const Uint32* inBuffer,
2184 bool readFixedSizeTHOneWordNotNULL(Uint8* outBuffer,
2191 bool updateFixedSizeTHOneWordNotNULL(Uint32* inBuffer,
2197 bool readFixedSizeTHTwoWordNotNULL(Uint8* outBuffer,
2204 bool updateFixedSizeTHTwoWordNotNULL(Uint32* inBuffer,
2210 bool readFixedSizeTHManyWordNotNULL(Uint8* outBuffer,
2217 bool fixsize_updater(Uint32* inBuffer,
2221 Uint32 updateOffset,
2222 Uint32 checkOffset);
2223 bool updateFixedSizeTHManyWordNotNULL(Uint32* inBuffer,
2229 bool readFixedSizeTHOneWordNULLable(Uint8* outBuffer,
2236 bool updateFixedSizeTHOneWordNULLable(Uint32* inBuffer,
2242 bool readFixedSizeTHTwoWordNULLable(Uint8* outBuffer,
2249 bool updateFixedSizeTHTwoWordNULLable(Uint32* inBuffer,
2255 bool readFixedSizeTHManyWordNULLable(Uint8* outBuffer,
2262 bool readFixedSizeTHZeroWordNULLable(Uint8* outBuffer,
2268 bool updateFixedSizeTHManyWordNULLable(Uint32* inBuffer,
2274 bool varsize_reader(Uint8* out_buffer,
2278 const void* src_ptr,
2279 Uint32 vsize_in_bytes);
2281 bool xfrm_reader(Uint8* out_buffer,
2285 const void* src_ptr,
2288 bool bits_reader(Uint8* out_buffer,
2291 const Uint32* bm_ptr, Uint32 bm_len,
2292 Uint32 bitPos, Uint32 bitCnt);
2294 bool varsize_updater(Uint32* in_buffer,
2296 char *var_data_start,
2297 Uint32 var_attr_pos,
2298 Uint16 *len_offset_ptr,
2299 Uint32 check_offset);
2302 bool readVarSizeNotNULL(Uint8* outBuffer,
2309 bool updateVarSizeNotNULL(Uint32* inBuffer,
2315 bool readVarSizeNULLable(Uint8* outBuffer,
2322 bool updateVarSizeNULLable(Uint32* inBuffer,
2328 bool readDynFixedSizeNotNULL(Uint8* outBuffer,
2332 bool readDynFixedSizeNULLable(Uint8* outBuffer,
2336 bool readDynFixedSizeExpandedNotNULL(Uint8* outBuffer,
2340 bool readDynFixedSizeShrunkenNotNULL(Uint8* outBuffer,
2344 bool readDynFixedSizeExpandedNULLable(Uint8* outBuffer,
2348 bool readDynFixedSizeShrunkenNULLable(Uint8* outBuffer,
2355 bool updateDynFixedSizeNotNULL(Uint32* inBuffer,
2358 bool updateDynFixedSizeNULLable(Uint32* inBuffer,
2364 bool readDynBigFixedSizeNotNULL(Uint8* outBuffer,
2368 bool readDynBigFixedSizeNULLable(Uint8* outBuffer,
2372 bool readDynBigFixedSizeExpandedNotNULL(Uint8* outBuffer,
2376 bool readDynBigFixedSizeShrunkenNotNULL(Uint8* outBuffer,
2380 bool readDynBigFixedSizeExpandedNULLable(Uint8* outBuffer,
2384 bool readDynBigFixedSizeShrunkenNULLable(Uint8* outBuffer,
2391 bool updateDynBigFixedSizeNotNULL(Uint32* inBuffer,
2394 bool updateDynBigFixedSizeNULLable(Uint32* inBuffer,
2400 bool readDynBitsNotNULL(Uint8* outBuffer,
2404 bool readDynBitsNULLable(Uint8* outBuffer,
2408 bool readDynBitsExpandedNotNULL(Uint8* outBuffer,
2412 bool readDynBitsShrunkenNotNULL(Uint8* outBuffer,
2416 bool readDynBitsExpandedNULLable(Uint8* outBuffer,
2420 bool readDynBitsShrunkenNULLable(Uint8* outBuffer,
2427 bool updateDynBitsNotNULL(Uint32* inBuffer,
2430 bool updateDynBitsNULLable(Uint32* inBuffer,
2436 bool readDynVarSizeNotNULL(Uint8* outBuffer,
2440 bool readDynVarSizeNULLable(Uint8* outBuffer,
2444 bool readDynVarSizeExpandedNotNULL(Uint8* outBuffer,
2448 bool readDynVarSizeShrunkenNotNULL(Uint8* outBuffer,
2452 bool readDynVarSizeExpandedNULLable(Uint8* outBuffer,
2456 bool readDynVarSizeShrunkenNULLable(Uint8* outBuffer,
2463 bool updateDynVarSizeNotNULL(Uint32* inBuffer,
2466 bool updateDynVarSizeNULLable(Uint32* inBuffer,
2470 bool readCharNotNULL(Uint8* outBuffer,
2475 bool readCharNULLable(Uint8* outBuffer,
2481 bool updateBitsNULLable(Uint32* inBuffer,
KeyReqStruct *req_struct, Uint32);
2483 bool updateBitsNotNULL(Uint32* inBuffer,
KeyReqStruct *req_struct, Uint32);
2485 bool updateFixedNULLable(Uint32* inBuffer,
KeyReqStruct *req_struct, Uint32);
2486 bool updateFixedNotNull(Uint32* inBuffer,
KeyReqStruct *req_struct, Uint32);
2488 bool updateVarNULLable(Uint32* inBuffer,
KeyReqStruct *req_struct, Uint32);
2489 bool updateVarNotNull(Uint32* inBuffer,
KeyReqStruct *req_struct, Uint32);
2492 bool readDiskFixedSizeNotNULL(Uint8* outBuffer,
2497 bool readDiskFixedSizeNULLable(Uint8* outBuffer,
2502 bool readDiskVarAsFixedSizeNotNULL(Uint8* outBuffer,
2507 bool readDiskVarAsFixedSizeNULLable(Uint8* outBuffer,
2514 bool updateDiskFixedSizeNULLable(Uint32*,
KeyReqStruct*, Uint32);
2515 bool updateDiskFixedSizeNotNULL(Uint32*,
KeyReqStruct*, Uint32);
2517 bool updateDiskVarAsFixedSizeNULLable(Uint32*,
KeyReqStruct*, Uint32);
2518 bool updateDiskVarAsFixedSizeNotNULL(Uint32*,
KeyReqStruct*, Uint32);
2520 bool updateDiskVarSizeNULLable(Uint32*,
KeyReqStruct *, Uint32);
2521 bool updateDiskVarSizeNotNULL(Uint32*,
KeyReqStruct *, Uint32);
2525 bool updateDiskBitsNULLable(Uint32*,
KeyReqStruct*, Uint32);
2526 bool updateDiskBitsNotNULL(Uint32*,
KeyReqStruct*, Uint32);
2534 void sendAlterTabRef(
Signal *signal, Uint32 errorCode);
2535 void sendAlterTabConf(
Signal *, Uint32 clientData=RNIL);
2537 void handleCharsetPos(Uint32 csNumber,
CHARSET_INFO** charsetArray,
2538 Uint32 noOfCharsets,
2539 Uint32 & charsetIndex, Uint32 & attrDes2);
2540 Uint32 computeTableMetaData(
Tablerec *regTabPtr);
2544 bool nullFlagCheck(
KeyReqStruct *req_struct, Uint32 attrDes2);
2545 bool disk_nullFlagCheck(
KeyReqStruct *req_struct, Uint32 attrDes2);
2546 int read_pseudo(
const Uint32 *, Uint32,
KeyReqStruct*, Uint32*);
2547 Uint32 read_packed(
const Uint32 *, Uint32,
KeyReqStruct*, Uint32*);
2548 Uint32 update_packed(
KeyReqStruct*,
const Uint32* src);
2550 Uint32 read_lcp(
const Uint32 *, Uint32,
KeyReqStruct*, Uint32*);
2551 void update_lcp(
KeyReqStruct *req_struct,
const Uint32* src, Uint32 len);
2553 void flush_read_buffer(
KeyReqStruct *,
const Uint32* outBuf,
2554 Uint32 resultRef, Uint32 resultData, Uint32 routeRef);
2559 Uint32
read_lcp_keys(Uint32,
const Uint32 * src, Uint32 len, Uint32 *dst);
2564 void setUpQueryRoutines(
Tablerec* regTabPtr);
2570 void set_trans_state(
Operationrec *
const, TransState);
2572 void set_tuple_state(
Operationrec *
const, TupleState);
2573 Uint32 get_frag_page_id(Uint32 real_page_id);
2574 Uint32 get_fix_page_offset(Uint32 page_index, Uint32 tuple_size);
2576 Uint32 decr_tup_version(Uint32 tuple_version);
2581 void set_commit_change_mask_info(
const Tablerec*,
2587 void copyAttrinfo(
Operationrec * regOperPtr, Uint32* inBuffer,
2588 Uint32 expectedLen, Uint32 attrInfoIVal);
2596 void initOperationrec(
Signal* signal);
2600 int getStoredProcAttrInfo(Uint32 storedId,
2602 Uint32& attrInfoIVal);
2611 int store_default_record(
const TablerecPtr& regTabPtr);
2615 void bufferTRANSID_AI(
Signal* signal, BlockReference aRef, Uint32 Tlen);
2622 TriggerType::Value ttype,
2623 TriggerActionTime::Value ttime,
2630 BlockNumber sender);
2635 checkImmediateTriggersAfterInsert(
KeyReqStruct *req_struct,
2641 checkImmediateTriggersAfterUpdate(
KeyReqStruct *req_struct,
2647 checkImmediateTriggersAfterDelete(
KeyReqStruct *req_struct,
2667 void checkDeferredTriggersDuringPrepare(
KeyReqStruct *req_struct,
2701 bool check_fire_reorg(
const KeyReqStruct *, Fragrecord::FragState)
const;
2712 Uint32* afterBuffer,
2713 Uint32& noAfterWords,
2714 Uint32* beforeBuffer,
2715 Uint32& noBeforeWords,
2718 void sendTrigAttrInfo(
Signal* signal,
2722 BlockReference receiverReference);
2725 Uint32 noOfAttributes,
2728 bool primaryKey(
Tablerec*
const, Uint32);
2732 int executeTuxInsertTriggers(
Signal* signal,
2737 int executeTuxUpdateTriggers(
Signal* signal,
2742 int executeTuxDeleteTriggers(
Signal* signal,
2747 int addTuxEntries(
Signal* signal,
2753 void executeTuxCommitTriggers(
Signal* signal,
2758 void executeTuxAbortTriggers(
Signal* signal,
2763 void removeTuxEntries(
Signal* signal,
2766 void ndbmtd_buffer_suma_trigger(
Signal* signal, Uint32 len,
2768 void flush_ndbmtd_suma_buffer(
Signal*);
2770 struct SumaTriggerBuffer
2772 SumaTriggerBuffer() { m_out_of_memory = 0;m_pageId = RNIL; m_freeWords = 0;}
2773 Uint32 m_out_of_memory;
2776 } m_suma_trigger_buffer;
2783 int TUPKEY_abort(KeyReqStruct*,
int error_type);
2787 void tupkeyErrorLab(KeyReqStruct*);
2789 bool do_tup_abort_operation(
Signal*, Tuple_header *,
2859 void checkPages(Fragrecord* regFragPtr);
2861 Uint32 convert_byte_to_word_size(Uint32 byte_size)
2863 return ((byte_size + 3) >> 2);
2865 Uint32 convert_bit_to_word_size(Uint32 bit_size)
2867 return ((bit_size + 31) >> 5);
2870 void prepare_initial_insert(KeyReqStruct*, Operationrec*, Tablerec*);
2871 void fix_disk_insert_no_mem_insert(KeyReqStruct*, Operationrec*, Tablerec*);
2872 void setup_fixed_part(KeyReqStruct* req_struct,
2873 Operationrec* regOperPtr,
2874 Tablerec* regTabPtr);
2876 void send_TUPKEYREF(
Signal* signal,
2877 Operationrec* regOperPtr);
2878 void early_tupkey_error(KeyReqStruct*);
2880 void printoutTuplePage(Uint32 fragid, Uint32 pageid, Uint32 printLimit);
2882 bool checkUpdateOfPrimaryKey(KeyReqStruct *req_struct,
2883 Uint32* updateBuffer,
2884 Tablerec* regTabPtr);
2886 void setNullBits(Uint32*, Tablerec* regTabPtr);
2887 bool checkNullAttributes(KeyReqStruct *
const, Tablerec*
const);
2888 bool find_savepoint(OperationrecPtr& loopOpPtr, Uint32 savepointId);
2889 bool setup_read(KeyReqStruct* req_struct,
2890 Operationrec* regOperPtr,
2891 Fragrecord* regFragPtr,
2892 Tablerec* regTabPtr,
2895 Uint32 calculateChecksum(Tuple_header*, Tablerec* regTabPtr);
2896 void setChecksum(Tuple_header*, Tablerec* regTabPtr);
2898 void complexTrigger(
Signal* signal,
2899 KeyReqStruct *req_struct,
2900 Operationrec* regOperPtr,
2901 Fragrecord* regFragPtr,
2902 Tablerec* regTabPtr);
2904 void setTupleStatesSetOpType(Operationrec* regOperPtr,
2905 KeyReqStruct *req_struct,
2908 OperationrecPtr& firstOpPtr);
2910 void findBeforeValueOperation(OperationrecPtr& befOpPtr,
2911 OperationrecPtr firstOpPtr);
2913 void updateGcpId(KeyReqStruct *req_struct,
2914 Operationrec* regOperPtr,
2915 Fragrecord* regFragPtr,
2916 Tablerec* regTabPtr);
2918 void setTupleStateOnPreviousOps(Uint32 prevOpIndex);
2919 void copyMem(
Signal* signal, Uint32 sourceIndex, Uint32 destIndex);
2921 void removeActiveOpList(Operationrec*
const regOperPtr, Tuple_header*);
2923 void updatePackedList(
Signal* signal, Uint16 ahostIndex);
2925 void setUpDescriptorReferences(Uint32 descriptorReference,
2926 Tablerec* regTabPtr,
2928 void setupDynDescriptorReferences(Uint32 dynDescr,
2929 Tablerec*
const regTabPtr,
2932 void setUpKeyArray(Tablerec* regTabPtr);
2933 bool addfragtotab(Tablerec* regTabPtr, Uint32 fragId, Uint32 fragIndex);
2934 void deleteFragTab(Tablerec* regTabPtr, Uint32 fragId);
2935 void abortAddFragOp(
Signal* signal);
2936 void releaseTabDescr(Tablerec* regTabPtr);
2937 void getFragmentrec(FragrecordPtr& regFragPtr, Uint32 fragId, Tablerec* regTabPtr);
2939 void initialiseRecordsLab(
Signal* signal, Uint32 switchData, Uint32, Uint32);
2940 void initializeCheckpointInfoRec();
2941 void initializeDiskBufferSegmentRecord();
2942 void initializeFragoperrec();
2943 void initializeFragrecord();
2944 void initializeAlterTabOperation();
2945 void initializeHostBuffer();
2946 void initializeLocalLogInfo();
2947 void initializeOperationrec();
2948 void initializePendingFileOpenInfoRecord();
2949 void initializeRestartInfoRec();
2950 void initializeTablerec();
2951 void initializeTabDescr();
2952 void initializeUndoPage();
2953 void initializeDefaultValuesFrag();
2955 void initTab(Tablerec* regTabPtr);
2957 void startphase3Lab(
Signal* signal, Uint32 config1, Uint32 config2);
2959 void fragrefuseLab(
Signal* signal, FragoperrecPtr fragOperPtr);
2960 void fragrefuse1Lab(
Signal* signal, FragoperrecPtr fragOperPtr);
2961 void fragrefuse2Lab(
Signal* signal, FragoperrecPtr fragOperPtr, FragrecordPtr regFragPtr);
2962 void fragrefuse3Lab(
Signal* signal,
2963 FragoperrecPtr fragOperPtr,
2964 FragrecordPtr regFragPtr,
2965 Tablerec* regTabPtr,
2967 void fragrefuse4Lab(
Signal* signal,
2968 FragoperrecPtr fragOperPtr,
2969 FragrecordPtr regFragPtr,
2970 Tablerec* regTabPtr,
2972 void addattrrefuseLab(
Signal* signal,
2973 FragrecordPtr regFragPtr,
2974 FragoperrecPtr fragOperPtr,
2975 Tablerec* regTabPtr,
2978 void releaseFragment(
Signal*, Uint32, Uint32);
2979 void drop_fragment_free_var_pages(
Signal*);
2980 void drop_fragment_free_pages(
Signal*);
2981 void drop_fragment_free_extent(
Signal*, TablerecPtr, FragrecordPtr, Uint32);
2982 void drop_fragment_free_extent_log_buffer_callback(
Signal*, Uint32, Uint32);
2983 void drop_fragment_unmap_pages(
Signal*, TablerecPtr, FragrecordPtr, Uint32);
2984 void drop_fragment_unmap_page_callback(
Signal* signal, Uint32, Uint32);
2985 void drop_fragment_fsremove(
Signal*, TablerecPtr, FragrecordPtr);
2986 void drop_fragment_fsremove_done(
Signal*, TablerecPtr, FragrecordPtr);
2993 #define EXTRA_COPY_PROC_WORDS 2
2994 #define MAX_COPY_PROC_LEN (MAX_ATTRIBUTES_IN_TABLE + EXTRA_COPY_PROC_WORDS)
2997 void deleteScanProcedure(
Signal* signal, Operationrec* regOperPtr);
2998 void allocCopyProcedure();
2999 void freeCopyProcedure();
3000 void prepareCopyProcedure(Uint32 numAttrs, Uint16 tableBits);
3001 void releaseCopyProcedure();
3002 void copyProcedure(
Signal* signal,
3003 TablerecPtr regTabPtr,
3004 Operationrec* regOperPtr);
3005 void scanProcedure(
Signal* signal,
3006 Operationrec* regOperPtr,
3009 void storedProcBufferSeizeErrorLab(
Signal* signal,
3010 Operationrec* regOperPtr,
3011 Uint32 storedProcPtr,
3019 Uint32 getTabDescrOffsets(Uint32, Uint32, Uint32, Uint32, Uint32*);
3020 Uint32 getDynTabDescrOffsets(Uint32 MaskSize, Uint32*
offset);
3021 Uint32 allocTabDescr(Uint32 allocSize);
3022 void releaseTabDescr(Uint32 desc);
3024 void freeTabDescr(Uint32 retRef, Uint32 retNo,
bool normal =
true);
3025 Uint32 getTabDescrWord(Uint32
index);
3026 void setTabDescrWord(Uint32
index, Uint32
word);
3029 Uint32 sizeOfReadFunction();
3030 void removeTdArea(Uint32 tabDesRef, Uint32 list);
3031 void insertTdArea(Uint32 tabDesRef, Uint32 list);
3032 void itdaMergeTabDescr(Uint32& retRef, Uint32& retNo,
bool normal);
3033 #if defined VM_TRACE || defined ERROR_INSERT
3034 void verifytabdes();
3037 void seizeOpRec(OperationrecPtr& regOperPtr);
3038 void seizeFragrecord(FragrecordPtr& regFragPtr);
3039 void seizeFragoperrec(FragoperrecPtr& fragOperPtr);
3040 void seizeAlterTabOperation(AlterTabOperationPtr& alterTabOpPtr);
3041 void releaseFragoperrec(FragoperrecPtr fragOperPtr);
3042 void releaseFragrec(FragrecordPtr);
3043 void releaseAlterTabOpRec(AlterTabOperationPtr regAlterTabOpPtr);
3050 void allocConsPages(Uint32 noOfPagesToAllocate,
3051 Uint32& noOfPagesAllocated,
3052 Uint32& allocPageRef);
3053 void returnCommonArea(Uint32 retPageRef, Uint32 retNo);
3054 void initializePage();
3056 Uint32 nextHigherTwoLog(Uint32 input);
3058 Uint32 m_pages_allocated;
3059 Uint32 m_pages_allocated_max;
3067 Uint32 getRealpid(Fragrecord* regFragPtr, Uint32 logicalPageId);
3068 Uint32 getRealpidCheck(Fragrecord* regFragPtr, Uint32 logicalPageId);
3069 Uint32 getNoOfPages(Fragrecord* regFragPtr);
3070 Uint32 getEmptyPage(Fragrecord* regFragPtr);
3071 Uint32 allocFragPage(Uint32 * err, Fragrecord* regFragPtr);
3072 Uint32 allocFragPage(Uint32 * err, Tablerec*, Fragrecord*, Uint32 page_no);
3073 void releaseFragPage(Fragrecord* regFragPtr, Uint32 logicalPageId, PagePtr);
3074 void rebuild_page_free_list(
Signal*);
3075 Uint32 get_empty_var_page(Fragrecord* frag_ptr);
3076 void init_page(Fragrecord*, PagePtr, Uint32 page_no);
3079 void errorHandler(Uint32 errorCode);
3088 void init_list_sizes(
void);
3092 Uint32 get_alloc_page(Fragrecord*
const, Uint32);
3093 void update_free_page_list(Fragrecord*
const,
Ptr<Page>);
3096 Uint32 calc_free_list(
const Tablerec* regTabPtr, Uint32 sz)
const {
3097 return regTabPtr->m_disk_alloc_info.calc_page_free_bits(sz);
3101 Uint32 calculate_free_list_impl(Uint32)
const ;
3102 Uint64 calculate_used_var_words(Fragrecord* fragPtr);
3103 void remove_free_page(Fragrecord*, Var_page*, Uint32);
3104 void insert_free_page(Fragrecord*, Var_page*, Uint32);
3112 Uint32* alloc_var_rec(Uint32 * err,
3113 Fragrecord*, Tablerec*, Uint32,
Local_key*, Uint32*);
3115 void free_var_part(Fragrecord*, Tablerec*,
Local_key*);
3116 Uint32* alloc_var_part(Uint32*err,Fragrecord*, Tablerec*, Uint32,
Local_key*);
3117 Uint32 *realloc_var_part(Uint32 * err, Fragrecord*, Tablerec*,
3118 PagePtr, Var_part_ref*, Uint32, Uint32);
3120 void move_var_part(Fragrecord* fragPtr, Tablerec* tabPtr, PagePtr pagePtr,
3121 Var_part_ref* refptr, Uint32
size);
3123 void free_var_part(Fragrecord* fragPtr, PagePtr pagePtr, Uint32 page_idx);
3125 void validate_page(Tablerec*, Var_page*
page);
3127 Uint32* alloc_fix_rec(Uint32 * err,
3128 Fragrecord*
const, Tablerec*
const,
Local_key*,
3130 void free_fix_rec(Fragrecord*, Tablerec*,
Local_key*, Fix_page*);
3132 Uint32* alloc_fix_rowid(Uint32 * err,
3133 Fragrecord*, Tablerec*,
Local_key*, Uint32 *);
3134 Uint32* alloc_var_rowid(Uint32 * err,
3135 Fragrecord*, Tablerec*, Uint32,
Local_key*, Uint32*);
3137 void convertThPage(Fix_page* regPagePtr,
3144 Uint32 alloc_tuple_from_page(Fragrecord* regFragPtr,
3145 Fix_page* regPagePtr);
3152 Uint32 c_lcp_scan_op;
3158 Fragoperrec *fragoperrec;
3159 Uint32 cfirstfreeFragopr;
3160 Uint32 cnoOfFragoprec;
3161 RSS_OP_COUNTER(cnoOfFreeFragoprec);
3162 RSS_OP_SNAPSHOT(cnoOfFreeFragoprec);
3164 Fragrecord *fragrecord;
3165 Uint32 cfirstfreefrag;
3166 Uint32 cnoOfFragrec;
3167 RSS_OP_COUNTER(cnoOfFreeFragrec);
3168 RSS_OP_SNAPSHOT(cnoOfFreeFragrec);
3175 FragrecordPtr DefaultValuesFragment;
3176 RSS_OP_SNAPSHOT(defaultValueWordsHi);
3177 RSS_OP_SNAPSHOT(defaultValueWordsLo);
3179 AlterTabOperation *alterTabOperRec;
3180 Uint32 cfirstfreeAlterTabOp;
3181 Uint32 cnoOfAlterTabOps;
3183 HostBuffer *hostBuffer;
3185 NdbMutex c_page_map_pool_mutex;
3192 Uint32 m_max_page_read_ahead;
3195 Uint32 cnoOfTablerec;
3197 TableDescriptor *tableDescriptor;
3198 Uint32 cnoOfTabDescrRec;
3199 RSS_OP_COUNTER(cnoOfFreeTabDescrRec);
3200 RSS_OP_SNAPSHOT(cnoOfFreeTabDescrRec);
3203 Uint32 cdataPages[16];
3204 Uint32 cpackedListIndex;
3205 Uint32 cpackedList[MAX_NODES];
3206 Uint32 cfreeTdList[16];
3207 Uint32 clastBitMask;
3208 Uint32 clblPageCounter;
3209 Uint32 clblPagesPerTick;
3210 Uint32 clblPagesPerTickAfterSr;
3211 BlockReference clqhBlockref;
3212 Uint32 clqhUserpointer;
3214 BlockReference cndbcntrRef;
3215 BlockReference cownref;
3218 Uint32 cCopyProcedure;
3219 Uint32 cCopyLastSeg;
3220 Uint32 cCopyOverwrite;
3221 Uint32 cCopyOverwriteLen;
3224 #define ZATTR_BUFFER_SIZE 16384
3225 Uint32 clogMemBuffer[ZATTR_BUFFER_SIZE + 16];
3226 Uint32 coutBuffer[ZATTR_BUFFER_SIZE + 16];
3227 Uint32 cinBuffer[ZATTR_BUFFER_SIZE + 16];
3228 Uint32 ctemp_page[ZWORDS_ON_PAGE];
3229 Uint32 ctemp_var_record[ZWORDS_ON_PAGE];
3232 Uint32 c_maxTriggersPerTable;
3234 Uint32 m_max_parallel_index_build;
3236 Uint32 c_errorInsert4000TableId;
3237 Uint32 c_min_list_size[MAX_FREE_LIST + 1];
3238 Uint32 c_max_list_size[MAX_FREE_LIST + 1];
3240 void initGlobalTemporaryVars();
3241 void reportMemoryUsage(
Signal* signal,
int incDec);
3248 friend class NdbOut& operator<<(NdbOut&,
const Operationrec&);
3249 friend class NdbOut& operator<<(NdbOut&,
const Th&);
3252 void expand_tuple(KeyReqStruct*, Uint32 sizes[4], Tuple_header*org,
3253 const Tablerec*,
bool disk);
3254 void shrink_tuple(KeyReqStruct*, Uint32 sizes[2],
const Tablerec*,
3257 Uint32* get_ptr(Var_part_ref);
3258 Uint32* get_ptr(PagePtr*, Var_part_ref);
3259 Uint32* get_ptr(PagePtr*,
const Local_key*,
const Tablerec*);
3260 Uint32* get_dd_ptr(PagePtr*,
const Local_key*,
const Tablerec*);
3261 Uint32* get_default_ptr(
const Tablerec*, Uint32&);
3262 Uint32 get_len(
Ptr<Page>* pagePtr, Var_part_ref ref);
3264 STATIC_CONST( COPY_TUPLE_HEADER32 = 4 );
3266 Tuple_header* alloc_copy_tuple(
const Tablerec* tabPtrP,
Local_key* ptr){
3268 tabPtrP->total_rec_size);
3269 if (unlikely(dst == 0))
3272 bzero(dst, tabPtrP->total_rec_size);
3274 Uint32 count = tabPtrP->m_no_of_attributes;
3275 ChangeMask * mask = (ChangeMask*)(dst + COPY_TUPLE_HEADER32);
3276 mask->m_cols = count;
3277 return (Tuple_header*)(mask->end_of_mask(count));
3280 Uint32 * get_copy_tuple_raw(
const Local_key* ptr) {
3281 return c_undo_buffer.
get_ptr(ptr);
3284 Tuple_header * get_copy_tuple(Uint32 * rawptr) {
3285 return (Tuple_header*)
3286 (get_change_mask_ptr(rawptr)->end_of_mask());
3289 ChangeMask * get_change_mask_ptr(Uint32 * rawptr) {
3290 return (ChangeMask*)(rawptr + COPY_TUPLE_HEADER32);
3293 Tuple_header* get_copy_tuple(
const Local_key* ptr){
3294 return get_copy_tuple(get_copy_tuple_raw(ptr));
3297 ChangeMask* get_change_mask_ptr(
const Tablerec* tabP,Tuple_header* copytuple){
3298 Uint32 * raw = (Uint32*)copytuple;
3299 Uint32 * tmp = raw - (1 + ((tabP->m_no_of_attributes + 31) >> 5));
3300 ChangeMask* mask = (ChangeMask*)tmp;
3301 assert(mask->end_of_mask() == raw);
3302 assert(get_copy_tuple(tmp - COPY_TUPLE_HEADER32) == copytuple);
3313 void disk_page_prealloc_dirty_page(Disk_alloc_info&,
3315 void disk_page_prealloc_transit_page(Disk_alloc_info&,
3318 void disk_page_abort_prealloc(
Signal*, Fragrecord*,
Local_key*, Uint32);
3319 void disk_page_abort_prealloc_callback(
Signal*, Uint32, Uint32);
3320 void disk_page_abort_prealloc_callback_1(
Signal*, Fragrecord*,
3323 void disk_page_prealloc_callback(
Signal*, Uint32, Uint32);
3324 void disk_page_prealloc_initial_callback(
Signal*, Uint32, Uint32);
3325 void disk_page_prealloc_callback_common(
Signal*,
3330 void disk_page_alloc(
Signal*,
3331 Tablerec*, Fragrecord*,
Local_key*, PagePtr, Uint32);
3332 void disk_page_free(
Signal*,
3333 Tablerec*, Fragrecord*,
Local_key*, PagePtr, Uint32);
3335 void disk_page_commit_callback(
Signal*, Uint32 opPtrI, Uint32 page_id);
3337 void disk_page_log_buffer_callback(
Signal*, Uint32 opPtrI, Uint32);
3339 void disk_page_alloc_extent_log_buffer_callback(
Signal*, Uint32, Uint32);
3340 void disk_page_free_extent_log_buffer_callback(
Signal*, Uint32, Uint32);
3342 Uint64 disk_page_undo_alloc(Page*,
const Local_key*,
3343 Uint32 sz, Uint32 gci, Uint32 logfile_group_id);
3345 Uint64 disk_page_undo_update(Page*,
const Local_key*,
3346 const Uint32*, Uint32,
3347 Uint32 gci, Uint32 logfile_group_id);
3349 Uint64 disk_page_undo_free(Page*,
const Local_key*,
3350 const Uint32*, Uint32 sz,
3351 Uint32 gci, Uint32 logfile_group_id);
3353 void undo_createtable_callback(
Signal* signal, Uint32 opPtrI, Uint32 unused);
3354 void undo_createtable_logsync_callback(
Signal* signal, Uint32, Uint32);
3356 void drop_table_log_buffer_callback(
Signal*, Uint32, Uint32);
3357 void drop_table_logsync_callback(
Signal*, Uint32, Uint32);
3360 void restart_setup_page(Disk_alloc_info&,
Ptr<Page>, Int32 estimate);
3363 void disk_page_move_page_request(Disk_alloc_info& alloc,
3366 Uint32 old_idx, Uint32 new_idx);
3368 void disk_page_move_dirty_page(Disk_alloc_info& alloc,
3371 Uint32 old_idx, Uint32 new_idx);
3373 void disk_page_get_allocated(
const Tablerec*,
const Fragrecord*,
3383 int disk_restart_alloc_extent(Uint32 tableId, Uint32 fragId,
3385 void disk_restart_page_bits(Uint32 tableId, Uint32 fragId,
3388 Uint32
type,
const Uint32 * ptr, Uint32 len);
3392 Uint32 m_type, m_len;
3393 const Uint32* m_ptr;
3403 void disk_restart_lcp_id(Uint32
table, Uint32 frag, Uint32 lcpId);
3409 Uint32 c_proxy_undo_data[20 + MAX_TUPLE_SIZE_IN_WORDS];
3411 void disk_restart_undo_next(
Signal*);
3412 void disk_restart_undo_lcp(Uint32, Uint32, Uint32 flag, Uint32 lcpId);
3413 void disk_restart_undo_callback(
Signal* signal, Uint32, Uint32);
3425 void findFirstOp(OperationrecPtr&);
3426 bool is_rowid_lcp_scanned(
const Local_key& key1,
3428 void commit_operation(
Signal*, Uint32, Uint32, Tuple_header*, PagePtr,
3429 Operationrec*, Fragrecord*, Tablerec*);
3430 void commit_refresh(
Signal*, Uint32, Uint32, Tuple_header*, PagePtr,
3431 KeyReqStruct*, Operationrec*, Fragrecord*, Tablerec*);
3432 int retrieve_data_page(
Signal*,
3435 int retrieve_log_page(
Signal*, FragrecordPtr, OperationrecPtr);
3437 void dealloc_tuple(
Signal* signal, Uint32, Uint32, Page*, Tuple_header*,
3438 KeyReqStruct*, Operationrec*, Fragrecord*, Tablerec*);
3439 bool store_extra_row_bits(Uint32,
const Tablerec*, Tuple_header*, Uint32,
3441 void read_extra_row_bits(Uint32,
const Tablerec*, Tuple_header*, Uint32 *,
3444 int handle_size_change_after_update(KeyReqStruct* req_struct,
3447 Fragrecord* regFragPtr,
3448 Tablerec* regTabPtr,
3450 int optimize_var_part(KeyReqStruct* req_struct,
3452 Operationrec* regOperPtr,
3453 Fragrecord* regFragPtr,
3454 Tablerec* regTabPtr);
3460 void prepare_read(KeyReqStruct*, Tablerec*
const,
bool disk);
3463 void dump_tuple(
const KeyReqStruct* req_struct,
const Tablerec* tabPtrP);
3466 void check_page_map(Fragrecord*);
3467 bool find_page_id_in_list(Fragrecord*, Uint32 pid);
3469 void handle_lcp_keep(
Signal*, Fragrecord*, ScanOp*);
3470 void handle_lcp_keep_commit(
const Local_key*,
3472 Operationrec*, Fragrecord*, Tablerec*);
3474 void setup_lcp_read_copy_tuple( KeyReqStruct *,
3479 bool isCopyTuple(Uint32 pageid, Uint32 pageidx)
const {
3480 return (pageidx & (Uint16(1) << 15)) != 0;
3483 void setCopyTuple(Uint32& pageid, Uint16& pageidx)
const {
3484 assert(!isCopyTuple(pageid, pageidx));
3485 pageidx |= (Uint16(1) << 15);
3486 assert(isCopyTuple(pageid, pageidx));
3489 void clearCopyTuple(Uint32& pageid, Uint16& pageidx)
const {
3490 assert(isCopyTuple(pageid, pageidx));
3491 pageidx &= ~(Uint16(1) << 15);
3492 assert(!isCopyTuple(pageid, pageidx));
3499 Dbtup::get_frag_page_id(Uint32 real_page_id)
3501 PagePtr real_page_ptr;
3502 real_page_ptr.i= real_page_id;
3503 ptrCheckGuard(real_page_ptr, cnoOfPage, cpage);
3504 return real_page_ptr.p->frag_page_id;
3510 Dbtup::get_trans_state(Operationrec * regOperPtr)
3512 return (Dbtup::TransState)regOperPtr->op_struct.trans_state;
3517 Dbtup::set_trans_state(Operationrec* regOperPtr,
3518 Dbtup::TransState trans_state)
3520 regOperPtr->op_struct.trans_state= (Uint32)trans_state;
3525 Dbtup::get_tuple_state(Operationrec * regOperPtr)
3527 return (Dbtup::TupleState)regOperPtr->op_struct.tuple_state;
3532 Dbtup::set_tuple_state(Operationrec* regOperPtr,
3533 Dbtup::TupleState tuple_state)
3535 regOperPtr->op_struct.tuple_state= (Uint32)tuple_state;
3541 Dbtup::decr_tup_version(Uint32 tup_version)
3543 return (tup_version - 1) & ZTUP_VERSION_MASK;
3548 Dbtup::get_ptr(Var_part_ref ref)
3551 return get_ptr(&tmp, ref);
3556 Dbtup::get_ptr(
Ptr<Page>* pagePtr, Var_part_ref ref)
3561 tmp.i = key.m_page_no;
3564 memcpy(pagePtr, &tmp,
sizeof(tmp));
3565 return ((Var_page*)tmp.p)->get_ptr(key.m_page_idx);
3570 Dbtup::get_ptr(PagePtr* pagePtr,
3571 const Local_key* key,
const Tablerec* regTabPtr)
3574 tmp.i= key->m_page_no;
3576 memcpy(pagePtr, &tmp,
sizeof(tmp));
3578 return ((Fix_page*)tmp.p)->
3579 get_ptr(key->m_page_idx, regTabPtr->m_offsets[MM].m_fix_header_size);
3584 Dbtup::get_default_ptr(
const Tablerec* regTabPtr, Uint32& default_len)
3587 ref.assign(®TabPtr->m_default_value_location);
3590 Uint32* default_data = get_ptr(&page, ref);
3591 default_len = get_len(&page, ref);
3593 return default_data;
3598 Dbtup::get_dd_ptr(PagePtr* pagePtr,
3599 const Local_key* key,
const Tablerec* regTabPtr)
3602 tmp.i= key->m_page_no;
3603 tmp.p= (Page*)m_global_page_pool.
getPtr(tmp.i);
3604 memcpy(pagePtr, &tmp,
sizeof(tmp));
3606 if(regTabPtr->m_attributes[DD].m_no_of_varsize ||
3607 regTabPtr->m_attributes[DD].m_no_of_dynamic)
3608 return ((Var_page*)tmp.p)->get_ptr(key->m_page_idx);
3610 return ((Fix_page*)tmp.p)->
3611 get_ptr(key->m_page_idx, regTabPtr->m_offsets[DD].m_fix_header_size);
3620 Dbtup::get_len(
Ptr<Page>* pagePtr, Var_part_ref ref)
3622 Uint32 page_idx= ref.m_page_idx;
3623 return ((Var_page*)pagePtr->p)->get_entry_len(page_idx);
3630 bool Dbtup::find_savepoint(OperationrecPtr& loopOpPtr, Uint32 savepointId)
3633 if (savepointId > loopOpPtr.p->savepointId) {
3637 loopOpPtr.i = loopOpPtr.p->prevActiveOp;
3638 if (loopOpPtr.i == RNIL) {
3641 c_operation_pool.
getPtr(loopOpPtr);
3648 Dbtup::update_change_mask_info(
const Tablerec* tablePtrP,
3652 assert(dst->m_cols == tablePtrP->m_no_of_attributes);
3653 Uint32 * ptr = dst->m_mask;
3654 Uint32 len = (tablePtrP->m_no_of_attributes + 31) >> 5;
3655 for (Uint32 i = 0; i<len; i++)
3665 Dbtup::set_change_mask_info(
const Tablerec* tablePtrP, ChangeMask* dst)
3667 assert(dst->m_cols == tablePtrP->m_no_of_attributes);
3668 Uint32 len = (tablePtrP->m_no_of_attributes + 31) >> 5;
3674 Dbtup::clear_change_mask_info(
const Tablerec* tablePtrP, ChangeMask* dst)
3676 assert(dst->m_cols == tablePtrP->m_no_of_attributes);
3677 Uint32 len = (tablePtrP->m_no_of_attributes + 31) >> 5;
3683 Dbtup::copy_change_mask_info(
const Tablerec* tablePtrP,
3684 ChangeMask* dst,
const ChangeMask* src)
3686 Uint32 dst_cols = tablePtrP->m_no_of_attributes;
3687 assert(dst->m_cols == dst_cols);
3688 Uint32 src_cols = src->m_cols;
3690 if (dst_cols == src_cols)
3692 memcpy(dst->m_mask, src->m_mask, 4 * ((dst_cols + 31) >> 5));
3696 ndbassert(dst_cols > src_cols);
3697 memcpy(dst->m_mask, src->m_mask, 4 * ((src_cols + 31) >> 5));
3699 src_cols, (dst_cols - src_cols));
3711 DEBUG_OUT_DEFINES(DBTUP);
3718 void disk_restart_undo(
Signal* signal, Uint64
lsn,
3719 Uint32
type,
const Uint32 * ptr, Uint32 len);
3723 int disk_restart_alloc_extent(Uint32 tableId, Uint32 fragId,
3726 void disk_restart_page_bits(Uint32 tableId, Uint32 fragId,