~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#ifndef DBACC_H
 
17
#define DBACC_H
 
18
 
 
19
#ifdef VM_TRACE
 
20
#define ACC_SAFE_QUEUE
 
21
#endif
 
22
 
 
23
#include <pc.hpp>
 
24
#include <SimulatedBlock.hpp>
 
25
 
 
26
#ifdef DBACC_C
 
27
// Debug Macros
 
28
#define dbgWord32(ptr, ind, val) 
 
29
 
 
30
/*
 
31
#define dbgWord32(ptr, ind, val) \
 
32
if(debug_jan){ \
 
33
tmp_val = val; \
 
34
switch(ind){ \
 
35
case 1: strcpy(tmp_string, "ZPOS_PAGE_TYPE   "); \
 
36
break; \
 
37
case 2: strcpy(tmp_string, "ZPOS_NO_ELEM_IN_PAGE"); \
 
38
break; \
 
39
case 3: strcpy(tmp_string, "ZPOS_CHECKSUM    "); \
 
40
break; \
 
41
case 4: strcpy(tmp_string, "ZPOS_OVERFLOWREC  "); \
 
42
break; \
 
43
case 5: strcpy(tmp_string, "ZPOS_FREE_AREA_IN_PAGE"); \
 
44
break; \
 
45
case 6: strcpy(tmp_string, "ZPOS_LAST_INDEX   "); \
 
46
break; \
 
47
case 7: strcpy(tmp_string, "ZPOS_INSERT_INDEX  "); \
 
48
break; \
 
49
case 8: strcpy(tmp_string, "ZPOS_ARRAY_POS    "); \
 
50
break; \
 
51
case 9: strcpy(tmp_string, "ZPOS_NEXT_FREE_INDEX"); \
 
52
break; \
 
53
case 10: strcpy(tmp_string, "ZPOS_NEXT_PAGE   "); \
 
54
break; \
 
55
case 11: strcpy(tmp_string, "ZPOS_PREV_PAGE   "); \
 
56
break; \
 
57
default: sprintf(tmp_string, "%-20d", ind);\
 
58
} \
 
59
ndbout << "Ptr: " << ptr.p->word32 << " \tIndex: " << tmp_string << " \tValue: " << tmp_val << " \tLINE: " << __LINE__ << endl; \
 
60
}\
 
61
*/
 
62
 
 
63
// Constants
 
64
/** ------------------------------------------------------------------------ 
 
65
 *   THESE ARE CONSTANTS THAT ARE USED FOR DEFINING THE SIZE OF BUFFERS, THE
 
66
 *   SIZE OF PAGE HEADERS, THE NUMBER OF BUFFERS IN A PAGE AND A NUMBER OF 
 
67
 *   OTHER CONSTANTS WHICH ARE CHANGED WHEN THE BUFFER SIZE IS CHANGED. 
 
68
 * ----------------------------------------------------------------------- */
 
69
#define ZHEAD_SIZE 32
 
70
#define ZCON_HEAD_SIZE 2
 
71
#define ZBUF_SIZE 28
 
72
#define ZEMPTYLIST 72
 
73
#define ZUP_LIMIT 14
 
74
#define ZDOWN_LIMIT 12
 
75
#define ZSHIFT_PLUS 5
 
76
#define ZSHIFT_MINUS 2
 
77
#define ZFREE_LIMIT 65
 
78
#define ZNO_CONTAINERS 64
 
79
#define ZELEM_HEAD_SIZE 1
 
80
/* ------------------------------------------------------------------------- */
 
81
/*  THESE CONSTANTS DEFINE THE USE OF THE PAGE HEADER IN THE INDEX PAGES.    */
 
82
/* ------------------------------------------------------------------------- */
 
83
#define ZPOS_PAGE_ID 0
 
84
#define ZPOS_PAGE_TYPE 1
 
85
#define ZPOS_PAGE_TYPE_BIT 14
 
86
#define ZPOS_EMPTY_LIST 1
 
87
#define ZPOS_ALLOC_CONTAINERS 2
 
88
#define ZPOS_CHECKSUM 3
 
89
#define ZPOS_OVERFLOWREC 4
 
90
#define ZPOS_NO_ELEM_IN_PAGE 2
 
91
#define ZPOS_FREE_AREA_IN_PAGE 5
 
92
#define ZPOS_LAST_INDEX 6
 
93
#define ZPOS_INSERT_INDEX 7
 
94
#define ZPOS_ARRAY_POS 8
 
95
#define ZPOS_NEXT_FREE_INDEX 9
 
96
#define ZPOS_NEXT_PAGE 10
 
97
#define ZPOS_PREV_PAGE 11
 
98
#define ZNORMAL_PAGE_TYPE 0
 
99
#define ZOVERFLOW_PAGE_TYPE 1
 
100
#define ZDEFAULT_LIST 3
 
101
#define ZWORDS_IN_PAGE 2048
 
102
#define ZADDFRAG 0
 
103
#define ZDIRARRAY 68
 
104
#define ZDIRRANGESIZE 65
 
105
//#define ZEMPTY_FRAGMENT 0
 
106
#define ZFRAGMENTSIZE 64
 
107
#define ZFIRSTTIME 1
 
108
#define ZFS_CONNECTSIZE 300
 
109
#define ZFS_OPSIZE 100
 
110
#define ZKEYINKEYREQ 4
 
111
#define ZLEFT 1
 
112
#define ZLOCALLOGFILE 2
 
113
#define ZLOCKED 0
 
114
#define ZMAXSCANSIGNALLEN 20
 
115
#define ZMAINKEYLEN 8
 
116
#define ZNO_OF_DISK_VERSION 3
 
117
#define ZNO_OF_OP_PER_SIGNAL 20
 
118
//#define ZNOT_EMPTY_FRAGMENT 1
 
119
#define ZOP_HEAD_INFO_LN 3
 
120
#define ZOPRECSIZE 740
 
121
#define ZOVERFLOWRECSIZE 5
 
122
#define ZPAGE8_BASE_ADD 1
 
123
#define ZPAGESIZE 128
 
124
#define ZPARALLEL_QUEUE 1
 
125
#define ZPDIRECTORY 1
 
126
#define ZSCAN_MAX_LOCK 4
 
127
#define ZSERIAL_QUEUE 2
 
128
#define ZSPH1 1
 
129
#define ZSPH2 2
 
130
#define ZSPH3 3
 
131
#define ZSPH6 6
 
132
#define ZREADLOCK 0
 
133
#define ZRIGHT 2
 
134
#define ZROOTFRAGMENTSIZE 32
 
135
#define ZSCAN_LOCK_ALL 3
 
136
/**
 
137
 * Check kernel_types for other operation types
 
138
 */
 
139
#define ZSCAN_OP 6
 
140
#define ZSCAN_REC_SIZE 256
 
141
#define ZSTAND_BY 2
 
142
#define ZTABLESIZE 16
 
143
#define ZTABMAXINDEX 3
 
144
#define ZUNDEFINED_OP 6
 
145
#define ZUNLOCKED 1
 
146
 
 
147
/* --------------------------------------------------------------------------------- */
 
148
/* CONTINUEB CODES                                                                   */
 
149
/* --------------------------------------------------------------------------------- */
 
150
#define ZINITIALISE_RECORDS 1
 
151
#define ZSEND_SCAN_HBREP 4
 
152
#define ZREL_ROOT_FRAG 5
 
153
#define ZREL_FRAG 6
 
154
#define ZREL_DIR 7
 
155
#define ZREPORT_MEMORY_USAGE 8
 
156
 
 
157
/* ------------------------------------------------------------------------- */
 
158
/* ERROR CODES                                                               */
 
159
/* ------------------------------------------------------------------------- */
 
160
#define ZLIMIT_OF_ERROR 600 // Limit check for error codes
 
161
#define ZCHECKROOT_ERROR 601 // Delete fragment error code
 
162
#define ZCONNECT_SIZE_ERROR 602 // ACC_SEIZEREF
 
163
#define ZDIR_RANGE_ERROR 603 // Add fragment error code
 
164
#define ZFULL_FRAGRECORD_ERROR 604 // Add fragment error code
 
165
#define ZFULL_ROOTFRAGRECORD_ERROR 605 // Add fragment error code
 
166
#define ZROOTFRAG_STATE_ERROR 606 // Add fragment
 
167
#define ZOVERTAB_REC_ERROR 607 // Add fragment
 
168
 
 
169
#define ZSCAN_REFACC_CONNECT_ERROR 608 // ACC_SCANREF
 
170
#define ZFOUR_ACTIVE_SCAN_ERROR 609 // ACC_SCANREF
 
171
#define ZNULL_SCAN_REC_ERROR 610 // ACC_SCANREF
 
172
 
 
173
#define ZDIRSIZE_ERROR 623
 
174
#define ZOVER_REC_ERROR 624 // Insufficient Space
 
175
#define ZPAGESIZE_ERROR 625
 
176
#define ZTUPLE_DELETED_ERROR 626
 
177
#define ZREAD_ERROR 626
 
178
#define ZWRITE_ERROR 630
 
179
#define ZTO_OP_STATE_ERROR 631
 
180
#define ZTOO_EARLY_ACCESS_ERROR 632
 
181
#endif
 
182
 
 
183
class ElementHeader {
 
184
  /**
 
185
   * 
 
186
   * l = Locked    -- If true contains operation else scan bits + hash value
 
187
   * s = Scan bits
 
188
   * h = Hash value
 
189
   * o = Operation ptr I
 
190
   *
 
191
   *           1111111111222222222233
 
192
   * 01234567890123456789012345678901
 
193
   * lssssssssssss   hhhhhhhhhhhhhhhh
 
194
   *  ooooooooooooooooooooooooooooooo
 
195
   */
 
196
public:
 
197
  STATIC_CONST( HASH_VALUE_PART_MASK = 0xFFFF );
 
198
  
 
199
  static bool getLocked(Uint32 data);
 
200
  static bool getUnlocked(Uint32 data);
 
201
  static Uint32 getScanBits(Uint32 data);
 
202
  static Uint32 getHashValuePart(Uint32 data);
 
203
  static Uint32 getOpPtrI(Uint32 data);
 
204
 
 
205
  static Uint32 setLocked(Uint32 opPtrI);
 
206
  static Uint32 setUnlocked(Uint32 hashValuePart, Uint32 scanBits);
 
207
  static Uint32 setScanBit(Uint32 header, Uint32 scanBit);
 
208
  static Uint32 clearScanBit(Uint32 header, Uint32 scanBit);
 
209
};
 
210
 
 
211
inline 
 
212
bool
 
213
ElementHeader::getLocked(Uint32 data){
 
214
  return (data & 1) == 0;
 
215
}
 
216
 
 
217
inline 
 
218
bool
 
219
ElementHeader::getUnlocked(Uint32 data){
 
220
  return (data & 1) == 1;
 
221
}
 
222
 
 
223
inline 
 
224
Uint32 
 
225
ElementHeader::getScanBits(Uint32 data){
 
226
  assert(getUnlocked(data));
 
227
  return (data >> 1) & ((1 << MAX_PARALLEL_SCANS_PER_FRAG) - 1);
 
228
}
 
229
 
 
230
inline 
 
231
Uint32 
 
232
ElementHeader::getHashValuePart(Uint32 data){
 
233
  assert(getUnlocked(data));
 
234
  return data >> 16;
 
235
}
 
236
 
 
237
inline
 
238
Uint32 
 
239
ElementHeader::getOpPtrI(Uint32 data){
 
240
  assert(getLocked(data));
 
241
  return data >> 1;
 
242
}
 
243
 
 
244
inline 
 
245
Uint32 
 
246
ElementHeader::setLocked(Uint32 opPtrI){
 
247
  return (opPtrI << 1) + 0;
 
248
}
 
249
inline
 
250
Uint32 
 
251
ElementHeader::setUnlocked(Uint32 hashValue, Uint32 scanBits){
 
252
  return (hashValue << 16) + (scanBits << 1) + 1;
 
253
}
 
254
 
 
255
inline
 
256
Uint32 
 
257
ElementHeader::setScanBit(Uint32 header, Uint32 scanBit){
 
258
  assert(getUnlocked(header));
 
259
  return header | (scanBit << 1);
 
260
}
 
261
 
 
262
inline
 
263
Uint32 
 
264
ElementHeader::clearScanBit(Uint32 header, Uint32 scanBit){
 
265
  assert(getUnlocked(header));
 
266
  return header & (~(scanBit << 1));
 
267
}
 
268
 
 
269
 
 
270
class Dbacc: public SimulatedBlock {
 
271
public:
 
272
// State values
 
273
enum State {
 
274
  FREEFRAG = 0,
 
275
  ACTIVEFRAG = 1,
 
276
  //SEND_QUE_OP = 2,
 
277
  WAIT_NOTHING = 10,
 
278
  WAIT_ONE_CONF = 26,
 
279
  FREE_OP = 30,
 
280
  WAIT_EXE_OP = 32,
 
281
  WAIT_IN_QUEUE = 34,
 
282
  EXE_OP = 35,
 
283
  SCAN_ACTIVE = 36,
 
284
  SCAN_WAIT_IN_QUEUE = 37,
 
285
  IDLE = 39,
 
286
  ACTIVE = 40,
 
287
  WAIT_COMMIT_ABORT = 41,
 
288
  ABORT = 42,
 
289
  ABORTADDFRAG = 43,
 
290
  REFUSEADDFRAG = 44,
 
291
  DELETEFRAG = 45,
 
292
  DELETETABLE = 46,
 
293
  UNDEFINEDROOT = 47,
 
294
  ADDFIRSTFRAG = 48,
 
295
  ADDSECONDFRAG = 49,
 
296
  DELETEFIRSTFRAG = 50,
 
297
  DELETESECONDFRAG = 51,
 
298
  ACTIVEROOT = 52
 
299
};
 
300
 
 
301
// Records
 
302
 
 
303
/* --------------------------------------------------------------------------------- */
 
304
/* DIRECTORY RANGE                                                                   */
 
305
/* --------------------------------------------------------------------------------- */
 
306
  struct DirRange {
 
307
    Uint32 dirArray[256];
 
308
  }; /* p2c: size = 1024 bytes */
 
309
  
 
310
  typedef Ptr<DirRange> DirRangePtr;
 
311
 
 
312
/* --------------------------------------------------------------------------------- */
 
313
/* DIRECTORYARRAY                                                                    */
 
314
/* --------------------------------------------------------------------------------- */
 
315
struct Directoryarray {
 
316
  Uint32 pagep[256];
 
317
}; /* p2c: size = 1024 bytes */
 
318
 
 
319
  typedef Ptr<Directoryarray> DirectoryarrayPtr;
 
320
 
 
321
/* --------------------------------------------------------------------------------- */
 
322
/* FRAGMENTREC. ALL INFORMATION ABOUT FRAMENT AND HASH TABLE IS SAVED IN FRAGMENT    */
 
323
/*         REC  A POINTER TO FRAGMENT RECORD IS SAVED IN ROOTFRAGMENTREC FRAGMENT    */
 
324
/* --------------------------------------------------------------------------------- */
 
325
struct Fragmentrec {
 
326
  Uint32 scan[MAX_PARALLEL_SCANS_PER_FRAG];
 
327
  union {
 
328
    Uint32 mytabptr;
 
329
    Uint32 myTableId;
 
330
  };
 
331
  union {
 
332
    Uint32 fragmentid;
 
333
    Uint32 myfid;
 
334
  };
 
335
  Uint32 roothashcheck;
 
336
  Uint32 noOfElements;
 
337
  Uint32 m_commit_count;
 
338
  State rootState;
 
339
  
 
340
//-----------------------------------------------------------------------------
 
341
// These variables keep track of allocated pages, the number of them and the
 
342
// start file page of them. Used during local checkpoints.
 
343
//-----------------------------------------------------------------------------
 
344
  Uint32 datapages[8];
 
345
  Uint32 activeDataPage;
 
346
 
 
347
//-----------------------------------------------------------------------------
 
348
// Temporary variables used during shrink and expand process.
 
349
//-----------------------------------------------------------------------------
 
350
  Uint32 expReceivePageptr;
 
351
  Uint32 expReceiveIndex;
 
352
  Uint32 expReceiveForward;
 
353
  Uint32 expSenderDirIndex;
 
354
  Uint32 expSenderDirptr;
 
355
  Uint32 expSenderIndex;
 
356
  Uint32 expSenderPageptr;
 
357
 
 
358
//-----------------------------------------------------------------------------
 
359
// List of lock owners and list of lock waiters to support LCP handling
 
360
//-----------------------------------------------------------------------------
 
361
  Uint32 lockOwnersList;
 
362
 
 
363
//-----------------------------------------------------------------------------
 
364
// References to Directory Ranges (which in turn references directories, which
 
365
// in its turn references the pages) for the bucket pages and the overflow
 
366
// bucket pages.
 
367
//-----------------------------------------------------------------------------
 
368
  Uint32 directory;
 
369
  Uint32 dirsize;
 
370
  Uint32 overflowdir;
 
371
  Uint32 lastOverIndex;
 
372
 
 
373
//-----------------------------------------------------------------------------
 
374
// We have a list of overflow pages with free areas. We have a special record,
 
375
// the overflow record representing these pages. The reason is that the
 
376
// same record is also used to represent pages in the directory array that have
 
377
// been released since they were empty (there were however higher indexes with
 
378
// data in them). These are put in the firstFreeDirIndexRec-list.
 
379
// An overflow record representing a page can only be in one of these lists.
 
380
//-----------------------------------------------------------------------------
 
381
  Uint32 firstOverflowRec;
 
382
  Uint32 lastOverflowRec;
 
383
  Uint32 firstFreeDirindexRec;
 
384
 
 
385
//-----------------------------------------------------------------------------
 
386
// Counter keeping track of how many times we have expanded. We need to ensure
 
387
// that we do not shrink so many times that this variable becomes negative.
 
388
//-----------------------------------------------------------------------------
 
389
  Uint32 expandCounter;
 
390
 
 
391
//-----------------------------------------------------------------------------
 
392
// These variables are important for the linear hashing algorithm.
 
393
// localkeylen is the size of the local key (1 and 2 is currently supported)
 
394
// maxloadfactor is the factor specifying when to expand
 
395
// minloadfactor is the factor specifying when to shrink (hysteresis model)
 
396
// maxp and p
 
397
// maxp and p is the variables most central to linear hashing. p + maxp + 1 is the
 
398
// current number of buckets. maxp is the largest value of the type 2**n - 1
 
399
// which is smaller than the number of buckets. These values are used to find
 
400
// correct bucket with the aid of the hash value.
 
401
//
 
402
// slack is the variable keeping track of whether we have inserted more than
 
403
// the current size is suitable for or less. Slack together with the boundaries
 
404
// set by maxloadfactor and minloadfactor decides when to expand/shrink
 
405
// slackCheck When slack goes over this value it is time to expand.
 
406
// slackCheck = (maxp + p + 1)*(maxloadfactor - minloadfactor) or 
 
407
// bucketSize * hysteresis
 
408
//-----------------------------------------------------------------------------
 
409
  Uint32 localkeylen;
 
410
  Uint32 maxp;
 
411
  Uint32 maxloadfactor;
 
412
  Uint32 minloadfactor;
 
413
  Uint32 p;
 
414
  Uint32 slack;
 
415
  Uint32 slackCheck;
 
416
 
 
417
//-----------------------------------------------------------------------------
 
418
// nextfreefrag is the next free fragment if linked into a free list
 
419
//-----------------------------------------------------------------------------
 
420
  Uint32 nextfreefrag;
 
421
 
 
422
//-----------------------------------------------------------------------------
 
423
// This variable is used during restore to keep track of page id of read pages.
 
424
// During read of bucket pages this is used to calculate the page id and also
 
425
// to verify that the page id of the read page is correct. During read of over-
 
426
// flow pages it is only used to keep track of the number of pages read.
 
427
//-----------------------------------------------------------------------------
 
428
  Uint32 nextAllocPage;
 
429
 
 
430
//-----------------------------------------------------------------------------
 
431
// Number of pages read from file during restore
 
432
//-----------------------------------------------------------------------------
 
433
  Uint32 noOfExpectedPages;
 
434
 
 
435
//-----------------------------------------------------------------------------
 
436
// Fragment State, mostly applicable during LCP and restore
 
437
//-----------------------------------------------------------------------------
 
438
  State fragState;
 
439
 
 
440
//-----------------------------------------------------------------------------
 
441
// elementLength: Length of element in bucket and overflow pages
 
442
// keyLength: Length of key
 
443
//-----------------------------------------------------------------------------
 
444
  Uint8 elementLength;
 
445
  Uint16 keyLength;
 
446
 
 
447
//-----------------------------------------------------------------------------
 
448
// This flag is used to avoid sending a big number of expand or shrink signals
 
449
// when simultaneously committing many inserts or deletes.
 
450
//-----------------------------------------------------------------------------
 
451
  Uint8 expandFlag;
 
452
 
 
453
//-----------------------------------------------------------------------------
 
454
// hashcheckbit is the bit to check whether to send element to split bucket or not
 
455
// k (== 6) is the number of buckets per page
 
456
// lhfragbits is the number of bits used to calculate the fragment id
 
457
// lhdirbits is the number of bits used to calculate the page id
 
458
//-----------------------------------------------------------------------------
 
459
  Uint8 hashcheckbit;
 
460
  Uint8 k;
 
461
  Uint8 lhfragbits;
 
462
  Uint8 lhdirbits;
 
463
 
 
464
//-----------------------------------------------------------------------------
 
465
// nodetype can only be STORED in this release. Is currently only set, never read
 
466
//-----------------------------------------------------------------------------
 
467
  Uint8 nodetype;
 
468
 
 
469
//-----------------------------------------------------------------------------
 
470
// flag to avoid accessing table record if no char attributes
 
471
//-----------------------------------------------------------------------------
 
472
  Uint8 hasCharAttr;
 
473
};
 
474
 
 
475
  typedef Ptr<Fragmentrec> FragmentrecPtr;
 
476
 
 
477
/* --------------------------------------------------------------------------------- */
 
478
/* OPERATIONREC                                                                      */
 
479
/* --------------------------------------------------------------------------------- */
 
480
struct Operationrec {
 
481
  Uint32 m_op_bits;
 
482
  Uint32 localdata[2];
 
483
  Uint32 elementIsforward;
 
484
  Uint32 elementPage;
 
485
  Uint32 elementPointer;
 
486
  Uint32 fid;
 
487
  Uint32 fragptr;
 
488
  Uint32 hashvaluePart;
 
489
  Uint32 hashValue;
 
490
  Uint32 nextLockOwnerOp;
 
491
  Uint32 nextOp;
 
492
  Uint32 nextParallelQue;
 
493
  union {
 
494
    Uint32 nextSerialQue;      
 
495
    Uint32 m_lock_owner_ptr_i; // if nextParallelQue = RNIL, else undefined
 
496
  };
 
497
  Uint32 prevOp;
 
498
  Uint32 prevLockOwnerOp;
 
499
  union {
 
500
    Uint32 prevParallelQue;
 
501
    Uint32 m_lo_last_parallel_op_ptr_i;
 
502
  };
 
503
  union {
 
504
    Uint32 prevSerialQue;
 
505
    Uint32 m_lo_last_serial_op_ptr_i;
 
506
  };
 
507
  Uint32 scanRecPtr;
 
508
  Uint32 transId1;
 
509
  Uint32 transId2;
 
510
  Uint32 userptr;
 
511
  Uint16 elementContainer;
 
512
  Uint16 tupkeylen;
 
513
  Uint32 xfrmtupkeylen;
 
514
  Uint32 userblockref;
 
515
  Uint32 scanBits;
 
516
 
 
517
  enum OpBits {
 
518
    OP_MASK                 = 0x0000F // 4 bits for operation type
 
519
    ,OP_LOCK_MODE           = 0x00010 // 0 - shared lock, 1 = exclusive lock
 
520
    ,OP_ACC_LOCK_MODE       = 0x00020 // Or:de lock mode of all operation
 
521
                                      // before me
 
522
    ,OP_LOCK_OWNER          = 0x00040
 
523
    ,OP_RUN_QUEUE           = 0x00080 // In parallell queue of lock owner
 
524
    ,OP_DIRTY_READ          = 0x00100
 
525
    ,OP_LOCK_REQ            = 0x00200 // isAccLockReq
 
526
    ,OP_COMMIT_DELETE_CHECK = 0x00400
 
527
    ,OP_INSERT_IS_DONE      = 0x00800
 
528
    ,OP_ELEMENT_DISAPPEARED = 0x01000
 
529
    
 
530
    ,OP_STATE_MASK          = 0xF0000
 
531
    ,OP_STATE_IDLE          = 0xF0000
 
532
    ,OP_STATE_WAITING       = 0x00000
 
533
    ,OP_STATE_RUNNING       = 0x10000
 
534
    ,OP_STATE_EXECUTED      = 0x30000
 
535
    
 
536
    ,OP_EXECUTED_DIRTY_READ = 0x3050F
 
537
    ,OP_INITIAL             = ~(Uint32)0
 
538
  };
 
539
  
 
540
  Operationrec() {}
 
541
  bool is_same_trans(const Operationrec* op) const {
 
542
    return 
 
543
      transId1 == op->transId1 && transId2 == op->transId2;
 
544
  }
 
545
  
 
546
}; /* p2c: size = 168 bytes */
 
547
 
 
548
  typedef Ptr<Operationrec> OperationrecPtr;
 
549
 
 
550
/* --------------------------------------------------------------------------------- */
 
551
/* OVERFLOW_RECORD                                                                   */
 
552
/* --------------------------------------------------------------------------------- */
 
553
struct OverflowRecord {
 
554
  Uint32 dirindex;
 
555
  Uint32 nextOverRec;
 
556
  Uint32 nextOverList;
 
557
  Uint32 prevOverRec;
 
558
  Uint32 prevOverList;
 
559
  Uint32 overpage;
 
560
  Uint32 nextfreeoverrec;
 
561
};
 
562
 
 
563
  typedef Ptr<OverflowRecord> OverflowRecordPtr;
 
564
 
 
565
/* --------------------------------------------------------------------------------- */
 
566
/* PAGE8                                                                             */
 
567
/* --------------------------------------------------------------------------------- */
 
568
struct Page8 {
 
569
  Uint32 word32[2048];
 
570
}; /* p2c: size = 8192 bytes */
 
571
 
 
572
  typedef Ptr<Page8> Page8Ptr;
 
573
 
 
574
/* --------------------------------------------------------------------------------- */
 
575
/* SCAN_REC                                                                          */
 
576
/* --------------------------------------------------------------------------------- */
 
577
struct ScanRec {
 
578
  enum ScanState {
 
579
    WAIT_NEXT,  
 
580
    SCAN_DISCONNECT
 
581
  };
 
582
  enum ScanBucketState {
 
583
    FIRST_LAP,
 
584
    SECOND_LAP,
 
585
    SCAN_COMPLETED
 
586
  };
 
587
  Uint32 activeLocalFrag;
 
588
  Uint32 nextBucketIndex;
 
589
  Uint32 scanNextfreerec;
 
590
  Uint32 scanFirstActiveOp;
 
591
  Uint32 scanFirstLockedOp;
 
592
  Uint32 scanLastLockedOp;
 
593
  Uint32 scanFirstQueuedOp;
 
594
  Uint32 scanLastQueuedOp;
 
595
  Uint32 scanUserptr;
 
596
  Uint32 scanTrid1;
 
597
  Uint32 scanTrid2;
 
598
  Uint32 startNoOfBuckets;
 
599
  Uint32 minBucketIndexToRescan;
 
600
  Uint32 maxBucketIndexToRescan;
 
601
  Uint32 scanOpsAllocated;
 
602
  ScanBucketState scanBucketState;
 
603
  ScanState scanState;
 
604
  Uint16 scanLockHeld;
 
605
  Uint32 scanUserblockref;
 
606
  Uint32 scanMask;
 
607
  Uint8 scanLockMode;
 
608
  Uint8 scanTimer;
 
609
  Uint8 scanContinuebCounter;
 
610
  Uint8 scanReadCommittedFlag;
 
611
}; 
 
612
 
 
613
  typedef Ptr<ScanRec> ScanRecPtr;
 
614
 
 
615
 
 
616
/* --------------------------------------------------------------------------------- */
 
617
/* TABREC                                                                            */
 
618
/* --------------------------------------------------------------------------------- */
 
619
struct Tabrec {
 
620
  Uint32 fragholder[MAX_FRAG_PER_NODE];
 
621
  Uint32 fragptrholder[MAX_FRAG_PER_NODE];
 
622
  Uint32 tabUserPtr;
 
623
  BlockReference tabUserRef;
 
624
};
 
625
  typedef Ptr<Tabrec> TabrecPtr;
 
626
 
 
627
public:
 
628
  Dbacc(Block_context&);
 
629
  virtual ~Dbacc();
 
630
 
 
631
  // pointer to TUP instance in this thread
 
632
  class Dbtup* c_tup;
 
633
  class Dblqh* c_lqh;
 
634
 
 
635
  void execACCMINUPDATE(Signal* signal);
 
636
 
 
637
private:
 
638
  BLOCK_DEFINES(Dbacc);
 
639
 
 
640
  // Transit signals
 
641
  void execDEBUG_SIG(Signal* signal);
 
642
  void execCONTINUEB(Signal* signal);
 
643
  void execACC_CHECK_SCAN(Signal* signal);
 
644
  void execEXPANDCHECK2(Signal* signal);
 
645
  void execSHRINKCHECK2(Signal* signal);
 
646
  void execACC_OVER_REC(Signal* signal);
 
647
  void execNEXTOPERATION(Signal* signal);
 
648
  void execREAD_PSEUDO_REQ(Signal* signal);
 
649
 
 
650
  // Received signals
 
651
  void execSTTOR(Signal* signal);
 
652
  void execACCKEYREQ(Signal* signal);
 
653
  void execACCSEIZEREQ(Signal* signal);
 
654
  void execACCFRAGREQ(Signal* signal);
 
655
  void execNEXT_SCANREQ(Signal* signal);
 
656
  void execACC_ABORTREQ(Signal* signal);
 
657
  void execACC_SCANREQ(Signal* signal);
 
658
  void execACC_COMMITREQ(Signal* signal);
 
659
  void execACC_TO_REQ(Signal* signal);
 
660
  void execACC_LOCKREQ(Signal* signal);
 
661
  void execNDB_STTOR(Signal* signal);
 
662
  void execDROP_TAB_REQ(Signal* signal);
 
663
  void execREAD_CONFIG_REQ(Signal* signal);
 
664
  void execDUMP_STATE_ORD(Signal* signal);
 
665
 
 
666
  // Statement blocks
 
667
  void ACCKEY_error(Uint32 fromWhere);
 
668
 
 
669
  void commitDeleteCheck();
 
670
  void report_dealloc(Signal* signal, const Operationrec* opPtrP);
 
671
  
 
672
  typedef void * RootfragmentrecPtr;
 
673
  void initRootFragPageZero(FragmentrecPtr, Page8Ptr);
 
674
  void initFragAdd(Signal*, FragmentrecPtr);
 
675
  void initFragPageZero(FragmentrecPtr, Page8Ptr);
 
676
  void initFragGeneral(FragmentrecPtr);
 
677
  void verifyFragCorrect(FragmentrecPtr regFragPtr);
 
678
  void releaseFragResources(Signal* signal, Uint32 fragIndex);
 
679
  void releaseRootFragRecord(Signal* signal, RootfragmentrecPtr rootPtr);
 
680
  void releaseRootFragResources(Signal* signal, Uint32 tableId);
 
681
  void releaseDirResources(Signal* signal,
 
682
                           Uint32 fragIndex,
 
683
                           Uint32 dirIndex,
 
684
                           Uint32 startIndex);
 
685
  void releaseDirectoryResources(Signal* signal,
 
686
                                 Uint32 fragIndex,
 
687
                                 Uint32 dirIndex,
 
688
                                 Uint32 startIndex,
 
689
                                 Uint32 directoryIndex);
 
690
  void releaseOverflowResources(Signal* signal, FragmentrecPtr regFragPtr);
 
691
  void releaseDirIndexResources(Signal* signal, FragmentrecPtr regFragPtr);
 
692
  void releaseFragRecord(Signal* signal, FragmentrecPtr regFragPtr);
 
693
  void initScanFragmentPart(Signal* signal);
 
694
  Uint32 checkScanExpand(Signal* signal);
 
695
  Uint32 checkScanShrink(Signal* signal);
 
696
  void initialiseDirRec(Signal* signal);
 
697
  void initialiseDirRangeRec(Signal* signal);
 
698
  void initialiseFragRec(Signal* signal);
 
699
  void initialiseFsConnectionRec(Signal* signal);
 
700
  void initialiseFsOpRec(Signal* signal);
 
701
  void initialiseOperationRec(Signal* signal);
 
702
  void initialiseOverflowRec(Signal* signal);
 
703
  void initialisePageRec(Signal* signal);
 
704
  void initialiseRootfragRec(Signal* signal);
 
705
  void initialiseScanRec(Signal* signal);
 
706
  void initialiseTableRec(Signal* signal);
 
707
  bool addfragtotab(Signal* signal, Uint32 rootIndex, Uint32 fragId);
 
708
  void initOpRec(Signal* signal);
 
709
  void sendAcckeyconf(Signal* signal);
 
710
  Uint32 getNoParallelTransaction(const Operationrec*);
 
711
 
 
712
#ifdef VM_TRACE
 
713
  Uint32 getNoParallelTransactionFull(const Operationrec*);
 
714
#endif
 
715
#ifdef ACC_SAFE_QUEUE
 
716
  bool validate_lock_queue(OperationrecPtr opPtr);
 
717
  Uint32 get_parallel_head(OperationrecPtr opPtr);
 
718
  void dump_lock_queue(OperationrecPtr loPtr);
 
719
#else
 
720
  bool validate_lock_queue(OperationrecPtr) { return true;}
 
721
#endif
 
722
  
 
723
public:  
 
724
  void execACCKEY_ORD(Signal* signal, Uint32 opPtrI);
 
725
  void startNext(Signal* signal, OperationrecPtr lastOp);
 
726
  
 
727
private:
 
728
  Uint32 placeReadInLockQueue(OperationrecPtr lockOwnerPtr);
 
729
  Uint32 placeWriteInLockQueue(OperationrecPtr lockOwnerPtr);
 
730
  void placeSerialQueue(OperationrecPtr lockOwner, OperationrecPtr op);
 
731
  void abortSerieQueueOperation(Signal* signal, OperationrecPtr op);  
 
732
  void abortParallelQueueOperation(Signal* signal, OperationrecPtr op);  
 
733
  
 
734
  void expandcontainer(Signal* signal);
 
735
  void shrinkcontainer(Signal* signal);
 
736
  void nextcontainerinfoExp(Signal* signal);
 
737
  void releaseAndCommitActiveOps(Signal* signal);
 
738
  void releaseAndCommitQueuedOps(Signal* signal);
 
739
  void releaseAndAbortLockedOps(Signal* signal);
 
740
  void containerinfo(Signal* signal);
 
741
  bool getScanElement(Signal* signal);
 
742
  void initScanOpRec(Signal* signal);
 
743
  void nextcontainerinfo(Signal* signal);
 
744
  void putActiveScanOp(Signal* signal);
 
745
  void putOpScanLockQue();
 
746
  void putReadyScanQueue(Signal* signal, Uint32 scanRecIndex);
 
747
  void releaseScanBucket(Signal* signal);
 
748
  void releaseScanContainer(Signal* signal);
 
749
  void releaseScanRec(Signal* signal);
 
750
  bool searchScanContainer(Signal* signal);
 
751
  void sendNextScanConf(Signal* signal);
 
752
  void setlock(Signal* signal);
 
753
  void takeOutActiveScanOp(Signal* signal);
 
754
  void takeOutScanLockQueue(Uint32 scanRecIndex);
 
755
  void takeOutReadyScanQueue(Signal* signal);
 
756
  void insertElement(Signal* signal);
 
757
  void insertContainer(Signal* signal);
 
758
  void addnewcontainer(Signal* signal);
 
759
  void getfreelist(Signal* signal);
 
760
  void increaselistcont(Signal* signal);
 
761
  void seizeLeftlist(Signal* signal);
 
762
  void seizeRightlist(Signal* signal);
 
763
  Uint32 readTablePk(Uint32 localkey1, Uint32 eh, OperationrecPtr);
 
764
  Uint32 getElement(Signal* signal, OperationrecPtr& lockOwner);
 
765
  void getdirindex(Signal* signal);
 
766
  void commitdelete(Signal* signal);
 
767
  void deleteElement(Signal* signal);
 
768
  void getLastAndRemove(Signal* signal);
 
769
  void releaseLeftlist(Signal* signal);
 
770
  void releaseRightlist(Signal* signal);
 
771
  void checkoverfreelist(Signal* signal);
 
772
  void abortOperation(Signal* signal);
 
773
  void commitOperation(Signal* signal);
 
774
  void copyOpInfo(OperationrecPtr dst, OperationrecPtr src);
 
775
  Uint32 executeNextOperation(Signal* signal);
 
776
  void releaselock(Signal* signal);
 
777
  void release_lockowner(Signal* signal, OperationrecPtr, bool commit);
 
778
  void startNew(Signal* signal, OperationrecPtr newOwner);
 
779
  void abortWaitingOperation(Signal*, OperationrecPtr);
 
780
  void abortExecutedOperation(Signal*, OperationrecPtr);
 
781
  
 
782
  void takeOutFragWaitQue(Signal* signal);
 
783
  void check_lock_upgrade(Signal* signal, OperationrecPtr release_op, bool lo);
 
784
  void check_lock_upgrade(Signal* signal, OperationrecPtr lock_owner,
 
785
                          OperationrecPtr release_op);
 
786
  void allocOverflowPage(Signal* signal);
 
787
  bool getfragmentrec(Signal* signal, FragmentrecPtr&, Uint32 fragId);
 
788
  void insertLockOwnersList(Signal* signal, const OperationrecPtr&);
 
789
  void takeOutLockOwnersList(Signal* signal, const OperationrecPtr&);
 
790
 
 
791
  void initFsOpRec(Signal* signal);
 
792
  void initOverpage(Signal* signal);
 
793
  void initPage(Signal* signal);
 
794
  void initRootfragrec(Signal* signal);
 
795
  void putOpInFragWaitQue(Signal* signal);
 
796
  void putOverflowRecInFrag(Signal* signal);
 
797
  void putRecInFreeOverdir(Signal* signal);
 
798
  void releaseDirectory(Signal* signal);
 
799
  void releaseDirrange(Signal* signal);
 
800
  void releaseFsConnRec(Signal* signal);
 
801
  void releaseFsOpRec(Signal* signal);
 
802
  void releaseOpRec(Signal* signal);
 
803
  void releaseOverflowRec(Signal* signal);
 
804
  void releaseOverpage(Signal* signal);
 
805
  void releasePage(Signal* signal);
 
806
  void releaseLogicalPage(Fragmentrec * fragP, Uint32 logicalPageId);
 
807
  void seizeDirectory(Signal* signal);
 
808
  void seizeDirrange(Signal* signal);
 
809
  void seizeFragrec(Signal* signal);
 
810
  void seizeFsConnectRec(Signal* signal);
 
811
  void seizeFsOpRec(Signal* signal);
 
812
  void seizeOpRec(Signal* signal);
 
813
  void seizeOverRec(Signal* signal);
 
814
  void seizePage(Signal* signal);
 
815
  void seizeRootfragrec(Signal* signal);
 
816
  void seizeScanRec(Signal* signal);
 
817
  void sendSystemerror(Signal* signal, int line);
 
818
  void takeRecOutOfFreeOverdir(Signal* signal);
 
819
  void takeRecOutOfFreeOverpage(Signal* signal);
 
820
  void sendScanHbRep(Signal* signal, Uint32);
 
821
 
 
822
  void addFragRefuse(Signal* signal, Uint32 errorCode);
 
823
  void ndbsttorryLab(Signal* signal);
 
824
  void acckeyref1Lab(Signal* signal, Uint32 result_code);
 
825
  void insertelementLab(Signal* signal);
 
826
  void checkNextFragmentLab(Signal* signal);
 
827
  void endofexpLab(Signal* signal);
 
828
  void endofshrinkbucketLab(Signal* signal);
 
829
  void senddatapagesLab(Signal* signal);
 
830
  void sttorrysignalLab(Signal* signal);
 
831
  void sendholdconfsignalLab(Signal* signal);
 
832
  void accIsLockedLab(Signal* signal, OperationrecPtr lockOwnerPtr);
 
833
  void insertExistElemLab(Signal* signal, OperationrecPtr lockOwnerPtr);
 
834
  void refaccConnectLab(Signal* signal);
 
835
  void releaseScanLab(Signal* signal);
 
836
  void ndbrestart1Lab(Signal* signal);
 
837
  void initialiseRecordsLab(Signal* signal, Uint32 ref, Uint32 data);
 
838
  void checkNextBucketLab(Signal* signal);
 
839
  void storeDataPageInDirectoryLab(Signal* signal);
 
840
 
 
841
  void zpagesize_error(const char* where);
 
842
 
 
843
  void reportMemoryUsage(Signal* signal, int gth);
 
844
  void reenable_expand_after_redo_log_exection_complete(Signal*);
 
845
 
 
846
  // charsets
 
847
  void xfrmKeyData(Signal* signal);
 
848
 
 
849
  // Initialisation
 
850
  void initData();
 
851
  void initRecords();
 
852
 
 
853
  // Variables
 
854
/* --------------------------------------------------------------------------------- */
 
855
/* DIRECTORY RANGE                                                                   */
 
856
/* --------------------------------------------------------------------------------- */
 
857
  DirRange *dirRange;
 
858
  DirRangePtr expDirRangePtr;
 
859
  DirRangePtr gnsDirRangePtr;
 
860
  DirRangePtr newDirRangePtr;
 
861
  DirRangePtr rdDirRangePtr;
 
862
  DirRangePtr nciOverflowrangeptr;
 
863
  Uint32 cdirrangesize;
 
864
  Uint32 cfirstfreeDirrange;
 
865
/* --------------------------------------------------------------------------------- */
 
866
/* DIRECTORYARRAY                                                                    */
 
867
/* --------------------------------------------------------------------------------- */
 
868
  Directoryarray *directoryarray;
 
869
  DirectoryarrayPtr expDirptr;
 
870
  DirectoryarrayPtr rdDirptr;
 
871
  DirectoryarrayPtr sdDirptr;
 
872
  DirectoryarrayPtr nciOverflowDirptr;
 
873
  Uint32 cdirarraysize;
 
874
  Uint32 cdirmemory;
 
875
  Uint32 cfirstfreedir;
 
876
/* --------------------------------------------------------------------------------- */
 
877
/* FRAGMENTREC. ALL INFORMATION ABOUT FRAMENT AND HASH TABLE IS SAVED IN FRAGMENT    */
 
878
/*         REC  A POINTER TO FRAGMENT RECORD IS SAVED IN ROOTFRAGMENTREC FRAGMENT    */
 
879
/* --------------------------------------------------------------------------------- */
 
880
  Fragmentrec *fragmentrec;
 
881
  FragmentrecPtr fragrecptr;
 
882
  Uint32 cfirstfreefrag;
 
883
  Uint32 cfragmentsize;
 
884
/* --------------------------------------------------------------------------------- */
 
885
/* FS_CONNECTREC                                                                     */
 
886
/* --------------------------------------------------------------------------------- */
 
887
/* OPERATIONREC                                                                      */
 
888
/* --------------------------------------------------------------------------------- */
 
889
  Operationrec *operationrec;
 
890
  OperationrecPtr operationRecPtr;
 
891
  OperationrecPtr idrOperationRecPtr;
 
892
  OperationrecPtr mlpqOperPtr;
 
893
  OperationrecPtr queOperPtr;
 
894
  OperationrecPtr readWriteOpPtr;
 
895
  Uint32 cfreeopRec;
 
896
  Uint32 coprecsize;
 
897
/* --------------------------------------------------------------------------------- */
 
898
/* OVERFLOW_RECORD                                                                   */
 
899
/* --------------------------------------------------------------------------------- */
 
900
  OverflowRecord *overflowRecord;
 
901
  OverflowRecordPtr iopOverflowRecPtr;
 
902
  OverflowRecordPtr tfoOverflowRecPtr;
 
903
  OverflowRecordPtr porOverflowRecPtr;
 
904
  OverflowRecordPtr priOverflowRecPtr;
 
905
  OverflowRecordPtr rorOverflowRecPtr;
 
906
  OverflowRecordPtr sorOverflowRecPtr;
 
907
  OverflowRecordPtr troOverflowRecPtr;
 
908
  Uint32 cfirstfreeoverrec;
 
909
  Uint32 coverflowrecsize;
 
910
 
 
911
/* --------------------------------------------------------------------------------- */
 
912
/* PAGE8                                                                             */
 
913
/* --------------------------------------------------------------------------------- */
 
914
  Page8 *page8;
 
915
  /* 8 KB PAGE                       */
 
916
  Page8Ptr ancPageptr;
 
917
  Page8Ptr colPageptr;
 
918
  Page8Ptr ccoPageptr;
 
919
  Page8Ptr datapageptr;
 
920
  Page8Ptr delPageptr;
 
921
  Page8Ptr excPageptr;
 
922
  Page8Ptr expPageptr;
 
923
  Page8Ptr gdiPageptr;
 
924
  Page8Ptr gePageptr;
 
925
  Page8Ptr gflPageptr;
 
926
  Page8Ptr idrPageptr;
 
927
  Page8Ptr ilcPageptr;
 
928
  Page8Ptr inpPageptr;
 
929
  Page8Ptr iopPageptr;
 
930
  Page8Ptr lastPageptr;
 
931
  Page8Ptr lastPrevpageptr;
 
932
  Page8Ptr lcnPageptr;
 
933
  Page8Ptr lcnCopyPageptr;
 
934
  Page8Ptr lupPageptr;
 
935
  Page8Ptr ciPageidptr;
 
936
  Page8Ptr gsePageidptr;
 
937
  Page8Ptr isoPageptr;
 
938
  Page8Ptr nciPageidptr;
 
939
  Page8Ptr rsbPageidptr;
 
940
  Page8Ptr rscPageidptr;
 
941
  Page8Ptr slPageidptr;
 
942
  Page8Ptr sscPageidptr;
 
943
  Page8Ptr rlPageptr;
 
944
  Page8Ptr rlpPageptr;
 
945
  Page8Ptr ropPageptr;
 
946
  Page8Ptr rpPageptr;
 
947
  Page8Ptr slPageptr;
 
948
  Page8Ptr spPageptr;
 
949
  Uint32 cfirstfreepage;
 
950
  Uint32 cfreepage;
 
951
  Uint32 cpagesize;
 
952
  Uint32 cnoOfAllocatedPages;
 
953
/* --------------------------------------------------------------------------------- */
 
954
/* ROOTFRAGMENTREC                                                                   */
 
955
/*          DURING EXPAND FRAGMENT PROCESS, EACH FRAGMEND WILL BE EXPAND INTO TWO    */
 
956
/*          NEW FRAGMENTS.TO MAKE THIS PROCESS EASIER, DURING ADD FRAGMENT PROCESS   */
 
957
/*          NEXT FRAGMENT IDENTIIES WILL BE CALCULATED, AND TWO FRAGMENTS WILL BE    */
 
958
/*          ADDED IN (NDBACC). THEREBY EXPAND OF FRAGMENT CAN BE PERFORMED QUICK AND */
 
959
/*          EASY.THE NEW FRAGMENT ID SENDS TO TUP MANAGER FOR ALL OPERATION PROCESS. */
 
960
/* --------------------------------------------------------------------------------- */
 
961
/* --------------------------------------------------------------------------------- */
 
962
/* SCAN_REC                                                                          */
 
963
/* --------------------------------------------------------------------------------- */
 
964
  ScanRec *scanRec;
 
965
  ScanRecPtr scanPtr;
 
966
  Uint32 cscanRecSize;
 
967
  Uint32 cfirstFreeScanRec;
 
968
/* --------------------------------------------------------------------------------- */
 
969
/* TABREC                                                                            */
 
970
/* --------------------------------------------------------------------------------- */
 
971
  Tabrec *tabrec;
 
972
  TabrecPtr tabptr;
 
973
  Uint32 ctablesize;
 
974
  Uint32 tgseElementptr;
 
975
  Uint32 tgseContainerptr;
 
976
  Uint32 trlHead;
 
977
  Uint32 trlRelCon;
 
978
  Uint32 trlNextused;
 
979
  Uint32 trlPrevused;
 
980
  Uint32 tlcnChecksum;
 
981
  Uint32 tlupElemIndex;
 
982
  Uint32 tlupIndex;
 
983
  Uint32 tlupForward;
 
984
  Uint32 tancNext;
 
985
  Uint32 tancBufType;
 
986
  Uint32 tancContainerptr;
 
987
  Uint32 tancPageindex;
 
988
  Uint32 tancPageid;
 
989
  Uint32 tidrResult;
 
990
  Uint32 tidrElemhead;
 
991
  Uint32 tidrForward;
 
992
  Uint32 tidrPageindex;
 
993
  Uint32 tidrContainerptr;
 
994
  Uint32 tidrContainerhead;
 
995
  Uint32 tlastForward;
 
996
  Uint32 tlastPageindex;
 
997
  Uint32 tlastContainerlen;
 
998
  Uint32 tlastElementptr;
 
999
  Uint32 tlastContainerptr;
 
1000
  Uint32 tlastContainerhead;
 
1001
  Uint32 trlPageindex;
 
1002
  Uint32 tdelContainerptr;
 
1003
  Uint32 tdelElementptr;
 
1004
  Uint32 tdelForward;
 
1005
  Uint32 tiopPageId;
 
1006
  Uint32 tipPageId;
 
1007
  Uint32 tgeContainerptr;
 
1008
  Uint32 tgeElementptr;
 
1009
  Uint32 tgeForward;
 
1010
  Uint32 texpReceivedBucket;
 
1011
  Uint32 texpDirInd;
 
1012
  Uint32 texpDirRangeIndex;
 
1013
  Uint32 texpDirPageIndex;
 
1014
  Uint32 tdata0;
 
1015
  Uint32 tcheckpointid;
 
1016
  Uint32 tciContainerptr;
 
1017
  Uint32 tnciContainerptr;
 
1018
  Uint32 tisoContainerptr;
 
1019
  Uint32 trscContainerptr;
 
1020
  Uint32 tsscContainerptr;
 
1021
  Uint32 tciContainerlen;
 
1022
  Uint32 trscContainerlen;
 
1023
  Uint32 tsscContainerlen;
 
1024
  Uint32 tciContainerhead;
 
1025
  Uint32 tnciContainerhead;
 
1026
  Uint32 tslElementptr;
 
1027
  Uint32 tisoElementptr;
 
1028
  Uint32 tsscElementptr;
 
1029
  Uint32 tfid;
 
1030
  Uint32 tscanFlag;
 
1031
  Uint32 tgflBufType;
 
1032
  Uint32 tgseIsforward;
 
1033
  Uint32 tsscIsforward;
 
1034
  Uint32 trscIsforward;
 
1035
  Uint32 tciIsforward;
 
1036
  Uint32 tnciIsforward;
 
1037
  Uint32 tisoIsforward;
 
1038
  Uint32 tgseIsLocked;
 
1039
  Uint32 tsscIsLocked;
 
1040
  Uint32 tkeylen;
 
1041
  Uint32 tmp;
 
1042
  Uint32 tmpP;
 
1043
  Uint32 tmpP2;
 
1044
  Uint32 tmp1;
 
1045
  Uint32 tmp2;
 
1046
  Uint32 tgflPageindex;
 
1047
  Uint32 tmpindex;
 
1048
  Uint32 tslNextfree;
 
1049
  Uint32 tslPageindex;
 
1050
  Uint32 tgsePageindex;
 
1051
  Uint32 tnciNextSamePage;
 
1052
  Uint32 tslPrevfree;
 
1053
  Uint32 tciPageindex;
 
1054
  Uint32 trsbPageindex;
 
1055
  Uint32 tnciPageindex;
 
1056
  Uint32 tlastPrevconptr;
 
1057
  Uint32 tresult;
 
1058
  Uint32 tslUpdateHeader;
 
1059
  Uint32 tuserptr;
 
1060
  BlockReference tuserblockref;
 
1061
  Uint32 tlqhPointer;
 
1062
  Uint32 tholdSentOp;
 
1063
  Uint32 tholdMore;
 
1064
  Uint32 tgdiPageindex;
 
1065
  Uint32 tiopIndex;
 
1066
  Uint32 tnciTmp;
 
1067
  Uint32 tullIndex;
 
1068
  Uint32 turlIndex;
 
1069
  Uint32 tlfrTmp1;
 
1070
  Uint32 tlfrTmp2;
 
1071
  Uint32 tscanTrid1;
 
1072
  Uint32 tscanTrid2;
 
1073
 
 
1074
  Uint32 ctest;
 
1075
  Uint32 clqhPtr;
 
1076
  BlockReference clqhBlockRef;
 
1077
  Uint32 cminusOne;
 
1078
  NodeId cmynodeid;
 
1079
  BlockReference cownBlockref;
 
1080
  BlockReference cndbcntrRef;
 
1081
  Uint16 csignalkey;
 
1082
  Uint32 czero;
 
1083
  Uint32 csystemRestart;
 
1084
  Uint32 cexcForward;
 
1085
  Uint32 cexcPageindex;
 
1086
  Uint32 cexcContainerptr;
 
1087
  Uint32 cexcContainerhead;
 
1088
  Uint32 cexcContainerlen;
 
1089
  Uint32 cexcElementptr;
 
1090
  Uint32 cexcPrevconptr;
 
1091
  Uint32 cexcMovedLen;
 
1092
  Uint32 cexcPrevpageptr;
 
1093
  Uint32 cexcPrevpageindex;
 
1094
  Uint32 cexcPrevforward;
 
1095
  Uint32 clocalkey[32];
 
1096
  union {
 
1097
  Uint32 ckeys[2048 * MAX_XFRM_MULTIPLY];
 
1098
  Uint64 ckeys_align;
 
1099
  };
 
1100
  
 
1101
  Uint32 c_errorInsert3000_TableId;
 
1102
  Uint32 c_memusage_report_frequency;
 
1103
};
 
1104
 
 
1105
#endif