1 /*
2    Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
3 
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License, version 2.0,
6    as published by the Free Software Foundation.
7 
8    This program is also distributed with certain software (including
9    but not limited to OpenSSL) that is licensed under separate terms,
10    as designated in a particular file or component or in included license
11    documentation.  The authors of MySQL hereby grant you an additional
12    permission to link the program and your derivative works with the
13    separately licensed software that they have included with MySQL.
14 
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License, version 2.0, for more details.
19 
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
23 */
24 
25 #ifndef SCAN_TAB_H
26 #define SCAN_TAB_H
27 
28 #include "SignalData.hpp"
29 
30 #define JAM_FILE_ID 56
31 
32 
33 /**
34  *
35  * SENDER:  API
36  * RECIVER: Dbtc
37  */
38 class ScanTabReq {
39   /**
40    * Reciver(s)
41    */
42   friend class Dbtc;         // Reciver
43 
44   /**
45    * Sender(s)
46    */
47   friend class NdbTransaction;
48   friend class NdbScanOperation;
49   friend class NdbIndexScanOperation;
50   friend class NdbQueryImpl;
51   friend class NdbScanFilterImpl;
52 
53   /**
54    * For printing
55    */
56   friend bool printSCANTABREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
57 
58 public:
59   /**
60    * Length of signal
61    */
62   STATIC_CONST( StaticLength = 11 );
63   STATIC_CONST( MaxTotalAttrInfo = 0xFFFF );
64 
65   /**
66    * Long section nums
67    */
68   STATIC_CONST( ReceiverIdSectionNum = 0 );
69   STATIC_CONST( AttrInfoSectionNum = 1 );    /* Long SCANTABREQ only */
70   STATIC_CONST( KeyInfoSectionNum = 2 );     /* Long SCANTABREQ only */
71 
72 private:
73 
74   // Type definitions
75 
76   /**
77    * DATA VARIABLES
78    */
79   UintR apiConnectPtr;        // DATA 0
80   union {
81     UintR attrLenKeyLen;      // DATA 1 : Short SCANTABREQ (Versions < 6.4.0)
82     UintR spare;              // DATA 1 : Long SCANTABREQ
83   };
84   UintR requestInfo;          // DATA 2
85   /*
86     Table ID. Note that for a range scan of a table using an ordered index,
87     tableID is the ID of the index, not of the underlying table.
88   */
89   UintR tableId;              // DATA 3
90   UintR tableSchemaVersion;   // DATA 4
91   UintR storedProcId;         // DATA 5
92   UintR transId1;             // DATA 6
93   UintR transId2;             // DATA 7
94   UintR buddyConPtr;          // DATA 8
95   UintR batch_byte_size;      // DATA 9
96   UintR first_batch_size;     // DATA 10
97 
98   /**
99    * Optional
100    */
101   Uint32 distributionKey;
102 
103   /**
104    * Get:ers for requestInfo
105    */
106   static Uint8 getParallelism(const UintR & requestInfo);
107   static Uint8 getLockMode(const UintR & requestInfo);
108   static Uint8 getHoldLockFlag(const UintR & requestInfo);
109   static Uint8 getReadCommittedFlag(const UintR & requestInfo);
110   static Uint8 getRangeScanFlag(const UintR & requestInfo);
111   static Uint8 getDescendingFlag(const UintR & requestInfo);
112   static Uint8 getTupScanFlag(const UintR & requestInfo);
113   static Uint8 getKeyinfoFlag(const UintR & requestInfo);
114   static Uint16 getScanBatch(const UintR & requestInfo);
115   static Uint8 getDistributionKeyFlag(const UintR & requestInfo);
116   static UintR getNoDiskFlag(const UintR & requestInfo);
117   static Uint32 getViaSPJFlag(const Uint32 & requestInfo);
118   static Uint32 getPassAllConfsFlag(const Uint32 & requestInfo);
119   static Uint32 getExtendedConf(const Uint32&);
120   static Uint8 getReadCommittedBaseFlag(const UintR & requestInfo);
121   static Uint32 getMultiFragFlag(const Uint32 & requestInfo);
122 
123   /**
124    * Set:ers for requestInfo
125    */
126   static void clearRequestInfo(UintR & requestInfo);
127   static void setParallelism(UintR & requestInfo, Uint32 flag);
128   static void setLockMode(UintR & requestInfo, Uint32 flag);
129   static void setHoldLockFlag(UintR & requestInfo, Uint32 flag);
130   static void setReadCommittedFlag(UintR & requestInfo, Uint32 flag);
131   static void setRangeScanFlag(UintR & requestInfo, Uint32 flag);
132   static void setDescendingFlag(UintR & requestInfo, Uint32 flag);
133   static void setTupScanFlag(UintR & requestInfo, Uint32 flag);
134   static void setKeyinfoFlag(UintR & requestInfo, Uint32 flag);
135   static void setScanBatch(Uint32& requestInfo, Uint32 sz);
136   static void setDistributionKeyFlag(Uint32& requestInfo, Uint32 flag);
137   static void setNoDiskFlag(UintR & requestInfo, UintR val);
138   static void setViaSPJFlag(Uint32 & requestInfo, Uint32 val);
139   static void setPassAllConfsFlag(Uint32 & requestInfo, Uint32 val);
140   static void setExtendedConf(Uint32 & requestInfo, Uint32 val);
141   static void setReadCommittedBaseFlag(Uint32 & requestInfo, Uint32 val);
142   static void setMultiFragFlag(Uint32 & requestInfo, Uint32 val);
143 };
144 
145 /**
146  * Request Info
147  *
148  p = Parallelism           - 8  Bits -> Max 255 (Bit 0-7).
149                                         Note: these bits are ignored since
150                                         7.0.34, 7.1.23, 7.2.7 and should be
151                                         zero-filled until future reuse.
152  l = Lock mode             - 1  Bit 8
153  h = Hold lock mode        - 1  Bit 10
154  c = Read Committed        - 1  Bit 11
155  k = Keyinfo               - 1  Bit 12  If set, LQH will send back a KEYINFO20
156                                         signal for each scanned row,
157                                         containing information needed to
158                                         identify the row for subsequent
159                                         TCKEYREQ signal(s).
160  t = Tup scan              - 1  Bit 13
161  z = Descending (TUX)      - 1  Bit 14
162  x = Range Scan (TUX)      - 1  Bit 15
163  b = Scan batch            - 10 Bit 16-25 (max 1023)
164  d = Distribution key flag - 1  Bit 26
165  n = No disk flag          - 1  Bit 9
166  j = Via SPJ flag          - 1  Bit 27
167  a = Pass all confs flag   - 1  Bit 28
168  f = 4 word conf           - 1  Bit 29
169  R = Read Committed base   - 1  Bit 30
170 
171            1111111111222222222233
172  01234567890123456789012345678901
173  pppppppplnhcktzxbbbbbbbbbbdjafR
174 */
175 
176 #define PARALLEL_SHIFT     (0)
177 #define PARALLEL_MASK      (255)
178 
179 #define LOCK_MODE_SHIFT     (8)
180 #define LOCK_MODE_MASK      (1)
181 
182 #define HOLD_LOCK_SHIFT     (10)
183 #define HOLD_LOCK_MASK      (1)
184 
185 #define KEYINFO_SHIFT       (12)
186 #define KEYINFO_MASK        (1)
187 
188 #define READ_COMMITTED_SHIFT     (11)
189 #define READ_COMMITTED_MASK      (1)
190 
191 #define RANGE_SCAN_SHIFT        (15)
192 #define RANGE_SCAN_MASK         (1)
193 
194 #define DESCENDING_SHIFT        (14)
195 #define DESCENDING_MASK         (1)
196 
197 #define TUP_SCAN_SHIFT          (13)
198 #define TUP_SCAN_MASK           (1)
199 
200 #define SCAN_BATCH_SHIFT (16)
201 #define SCAN_BATCH_MASK  (1023)
202 
203 #define SCAN_DISTR_KEY_SHIFT (26)
204 #define SCAN_DISTR_KEY_MASK (1)
205 
206 #define SCAN_NODISK_SHIFT (9)
207 #define SCAN_NODISK_MASK (1)
208 
209 #define SCAN_SPJ_SHIFT (27)
210 #define SCAN_PASS_CONF_SHIFT (28)
211 #define SCAN_EXTENDED_CONF_SHIFT (29)
212 #define SCAN_READ_COMMITTED_BASE_SHIFT (30)
213 #define SCAN_MULTI_FRAG_SHIFT (31)
214 
215 inline
216 Uint8
getReadCommittedBaseFlag(const UintR & requestInfo)217 ScanTabReq::getReadCommittedBaseFlag(const UintR & requestInfo){
218   return (Uint8)((requestInfo >> SCAN_READ_COMMITTED_BASE_SHIFT) & 1);
219 }
220 
221 inline
222 Uint8
getParallelism(const UintR & requestInfo)223 ScanTabReq::getParallelism(const UintR & requestInfo){
224   return (Uint8)((requestInfo >> PARALLEL_SHIFT) & PARALLEL_MASK);
225 }
226 
227 inline
228 Uint8
getLockMode(const UintR & requestInfo)229 ScanTabReq::getLockMode(const UintR & requestInfo){
230   return (Uint8)((requestInfo >> LOCK_MODE_SHIFT) & LOCK_MODE_MASK);
231 }
232 
233 inline
234 Uint8
getHoldLockFlag(const UintR & requestInfo)235 ScanTabReq::getHoldLockFlag(const UintR & requestInfo){
236   return (Uint8)((requestInfo >> HOLD_LOCK_SHIFT) & HOLD_LOCK_MASK);
237 }
238 
239 inline
240 Uint8
getReadCommittedFlag(const UintR & requestInfo)241 ScanTabReq::getReadCommittedFlag(const UintR & requestInfo){
242   return (Uint8)((requestInfo >> READ_COMMITTED_SHIFT) & READ_COMMITTED_MASK);
243 }
244 
245 inline
246 Uint8
getRangeScanFlag(const UintR & requestInfo)247 ScanTabReq::getRangeScanFlag(const UintR & requestInfo){
248   return (Uint8)((requestInfo >> RANGE_SCAN_SHIFT) & RANGE_SCAN_MASK);
249 }
250 
251 inline
252 Uint8
getDescendingFlag(const UintR & requestInfo)253 ScanTabReq::getDescendingFlag(const UintR & requestInfo){
254   return (Uint8)((requestInfo >> DESCENDING_SHIFT) & DESCENDING_MASK);
255 }
256 
257 inline
258 Uint8
getTupScanFlag(const UintR & requestInfo)259 ScanTabReq::getTupScanFlag(const UintR & requestInfo){
260   return (Uint8)((requestInfo >> TUP_SCAN_SHIFT) & TUP_SCAN_MASK);
261 }
262 
263 inline
264 Uint16
getScanBatch(const Uint32 & requestInfo)265 ScanTabReq::getScanBatch(const Uint32 & requestInfo){
266   return (Uint16)((requestInfo >> SCAN_BATCH_SHIFT) & SCAN_BATCH_MASK);
267 }
268 
269 inline
270 void
clearRequestInfo(UintR & requestInfo)271 ScanTabReq::clearRequestInfo(UintR & requestInfo){
272   requestInfo = 0;
273 }
274 
275 inline
276 void
setReadCommittedBaseFlag(UintR & requestInfo,Uint32 type)277 ScanTabReq::setReadCommittedBaseFlag(UintR & requestInfo, Uint32 type){
278   ASSERT_MAX(type, 1, "ScanTabReq::setReadCommittedBase");
279   requestInfo= (requestInfo & ~(1 << SCAN_READ_COMMITTED_BASE_SHIFT)) |
280                ((type & 1) << SCAN_READ_COMMITTED_BASE_SHIFT);
281 }
282 
283 inline
284 void
setParallelism(UintR & requestInfo,Uint32 type)285 ScanTabReq::setParallelism(UintR & requestInfo, Uint32 type){
286   ASSERT_MAX(type, PARALLEL_MASK, "ScanTabReq::setParallelism");
287   requestInfo= (requestInfo & ~(PARALLEL_MASK << PARALLEL_SHIFT)) |
288                ((type & PARALLEL_MASK) << PARALLEL_SHIFT);
289 }
290 
291 inline
292 void
setLockMode(UintR & requestInfo,Uint32 mode)293 ScanTabReq::setLockMode(UintR & requestInfo, Uint32 mode){
294   ASSERT_MAX(mode, LOCK_MODE_MASK,  "ScanTabReq::setLockMode");
295   requestInfo= (requestInfo & ~(LOCK_MODE_MASK << LOCK_MODE_SHIFT)) |
296                ((mode & LOCK_MODE_MASK) << LOCK_MODE_SHIFT);
297 }
298 
299 inline
300 void
setHoldLockFlag(UintR & requestInfo,Uint32 flag)301 ScanTabReq::setHoldLockFlag(UintR & requestInfo, Uint32 flag){
302   ASSERT_BOOL(flag, "ScanTabReq::setHoldLockFlag");
303   requestInfo= (requestInfo & ~(HOLD_LOCK_MASK << HOLD_LOCK_SHIFT)) |
304                ((flag & HOLD_LOCK_MASK) << HOLD_LOCK_SHIFT);
305 }
306 
307 inline
308 void
setReadCommittedFlag(UintR & requestInfo,Uint32 flag)309 ScanTabReq::setReadCommittedFlag(UintR & requestInfo, Uint32 flag){
310   ASSERT_BOOL(flag, "ScanTabReq::setReadCommittedFlag");
311   requestInfo= (requestInfo & ~(READ_COMMITTED_MASK << READ_COMMITTED_SHIFT)) |
312                ((flag & READ_COMMITTED_MASK) << READ_COMMITTED_SHIFT);
313 }
314 
315 inline
316 void
setRangeScanFlag(UintR & requestInfo,Uint32 flag)317 ScanTabReq::setRangeScanFlag(UintR & requestInfo, Uint32 flag){
318   ASSERT_BOOL(flag, "ScanTabReq::setRangeScanFlag");
319   requestInfo= (requestInfo & ~(RANGE_SCAN_MASK << RANGE_SCAN_SHIFT)) |
320                ((flag & RANGE_SCAN_MASK) << RANGE_SCAN_SHIFT);
321 }
322 
323 inline
324 void
setDescendingFlag(UintR & requestInfo,Uint32 flag)325 ScanTabReq::setDescendingFlag(UintR & requestInfo, Uint32 flag){
326   ASSERT_BOOL(flag, "ScanTabReq::setDescendingFlag");
327   requestInfo= (requestInfo & ~(DESCENDING_MASK << DESCENDING_SHIFT)) |
328                ((flag & DESCENDING_MASK) << DESCENDING_SHIFT);
329 }
330 
331 inline
332 void
setTupScanFlag(UintR & requestInfo,Uint32 flag)333 ScanTabReq::setTupScanFlag(UintR & requestInfo, Uint32 flag){
334   ASSERT_BOOL(flag, "ScanTabReq::setTupScanFlag");
335   requestInfo= (requestInfo & ~(TUP_SCAN_MASK << TUP_SCAN_SHIFT)) |
336                ((flag & TUP_SCAN_MASK) << TUP_SCAN_SHIFT);
337 }
338 
339 inline
340 void
setScanBatch(Uint32 & requestInfo,Uint32 flag)341 ScanTabReq::setScanBatch(Uint32 & requestInfo, Uint32 flag){
342   ASSERT_MAX(flag, SCAN_BATCH_MASK,  "ScanTabReq::setScanBatch");
343   requestInfo= (requestInfo & ~(SCAN_BATCH_MASK << SCAN_BATCH_SHIFT)) |
344                ((flag & SCAN_BATCH_MASK) << SCAN_BATCH_SHIFT);
345 }
346 
347 inline
348 Uint8
getKeyinfoFlag(const UintR & requestInfo)349 ScanTabReq::getKeyinfoFlag(const UintR & requestInfo){
350   return (Uint8)((requestInfo >> KEYINFO_SHIFT) & KEYINFO_MASK);
351 }
352 
353 inline
354 void
setKeyinfoFlag(UintR & requestInfo,Uint32 flag)355 ScanTabReq::setKeyinfoFlag(UintR & requestInfo, Uint32 flag){
356   ASSERT_BOOL(flag, "ScanTabReq::setKeyinfoFlag");
357   requestInfo= (requestInfo & ~(KEYINFO_MASK << KEYINFO_SHIFT)) |
358                ((flag & KEYINFO_MASK) << KEYINFO_SHIFT);
359 }
360 
361 inline
362 Uint8
getDistributionKeyFlag(const UintR & requestInfo)363 ScanTabReq::getDistributionKeyFlag(const UintR & requestInfo){
364   return (Uint8)((requestInfo >> SCAN_DISTR_KEY_SHIFT) & SCAN_DISTR_KEY_MASK);
365 }
366 
367 inline
368 void
setDistributionKeyFlag(UintR & requestInfo,Uint32 flag)369 ScanTabReq::setDistributionKeyFlag(UintR & requestInfo, Uint32 flag){
370   ASSERT_BOOL(flag, "ScanTabReq::setKeyinfoFlag");
371   requestInfo= (requestInfo & ~(SCAN_DISTR_KEY_MASK << SCAN_DISTR_KEY_SHIFT)) |
372                ((flag & SCAN_DISTR_KEY_MASK) << SCAN_DISTR_KEY_SHIFT);
373 }
374 
375 inline
376 UintR
getNoDiskFlag(const UintR & requestInfo)377 ScanTabReq::getNoDiskFlag(const UintR & requestInfo){
378   return (requestInfo >> SCAN_NODISK_SHIFT) & SCAN_NODISK_MASK;
379 }
380 
381 inline
382 void
setNoDiskFlag(UintR & requestInfo,Uint32 flag)383 ScanTabReq::setNoDiskFlag(UintR & requestInfo, Uint32 flag){
384   ASSERT_BOOL(flag, "TcKeyReq::setNoDiskFlag");
385   requestInfo= (requestInfo & ~(SCAN_NODISK_MASK << SCAN_NODISK_SHIFT)) |
386                ((flag & SCAN_NODISK_MASK) << SCAN_NODISK_SHIFT);
387 }
388 
389 inline
390 UintR
getViaSPJFlag(const UintR & requestInfo)391 ScanTabReq::getViaSPJFlag(const UintR & requestInfo){
392   return (requestInfo >> SCAN_SPJ_SHIFT) & 1;
393 }
394 
395 inline
396 void
setViaSPJFlag(UintR & requestInfo,Uint32 flag)397 ScanTabReq::setViaSPJFlag(UintR & requestInfo, Uint32 flag){
398   ASSERT_BOOL(flag, "TcKeyReq::setViaSPJFlag");
399   requestInfo |= (flag << SCAN_SPJ_SHIFT);
400 }
401 
402 inline
403 UintR
getPassAllConfsFlag(const UintR & requestInfo)404 ScanTabReq::getPassAllConfsFlag(const UintR & requestInfo){
405   return (requestInfo >> SCAN_PASS_CONF_SHIFT) & 1;
406 }
407 
408 inline
409 void
setPassAllConfsFlag(UintR & requestInfo,Uint32 flag)410 ScanTabReq::setPassAllConfsFlag(UintR & requestInfo, Uint32 flag){
411   ASSERT_BOOL(flag, "TcKeyReq::setPassAllConfs");
412   requestInfo |= (flag << SCAN_PASS_CONF_SHIFT);
413 }
414 
415 inline
416 UintR
getExtendedConf(const UintR & requestInfo)417 ScanTabReq::getExtendedConf(const UintR & requestInfo){
418   return (requestInfo >> SCAN_EXTENDED_CONF_SHIFT) & 1;
419 }
420 
421 inline
422 void
setExtendedConf(UintR & requestInfo,Uint32 flag)423 ScanTabReq::setExtendedConf(UintR & requestInfo, Uint32 flag){
424   ASSERT_BOOL(flag, "ScanTabReq::setExtendedConf");
425   requestInfo |= (flag << SCAN_EXTENDED_CONF_SHIFT);
426 }
427 
428 /**
429  * MULTI_FRAG flag can currently only be used together
430  * with ViaSPJ flag.
431  */
432 inline
433 UintR
getMultiFragFlag(const UintR & requestInfo)434 ScanTabReq::getMultiFragFlag(const UintR & requestInfo){
435   return (requestInfo >> SCAN_MULTI_FRAG_SHIFT) & 1;
436 }
437 
438 inline
439 void
setMultiFragFlag(UintR & requestInfo,Uint32 flag)440 ScanTabReq::setMultiFragFlag(UintR & requestInfo, Uint32 flag){
441   ASSERT_BOOL(flag, "TcKeyReq::setMultiFragFlag");
442   requestInfo= (requestInfo & ~(1 << SCAN_MULTI_FRAG_SHIFT)) |
443                (flag << SCAN_MULTI_FRAG_SHIFT);
444 }
445 
446 /**
447  *
448  * SENDER:  Dbtc
449  * RECIVER: API
450  */
451 class ScanTabConf {
452   /**
453    * Reciver(s)
454    */
455   friend class NdbTransaction;         // Reciver
456 
457   /**
458    * Sender(s)
459    */
460   friend class Dbtc;
461 
462   /**
463    * For printing
464    */
465   friend bool printSCANTABCONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
466 
467 public:
468   /**
469    * Length of signal
470    */
471   STATIC_CONST( SignalLength = 4 );
472   STATIC_CONST( EndOfData = (1 << 31) );
473 
474 private:
475 
476   // Type definitions
477 
478   /**
479    * DATA VARIABLES
480    */
481   UintR apiConnectPtr;        // DATA 0
482   UintR requestInfo;          // DATA 1
483   UintR transId1;             // DATA 2
484   UintR transId2;             // DATA 3
485 
486   struct OpData {
487     Uint32 apiPtrI;
488     /*
489       tcPtrI is the scan fragment record pointer, used in SCAN_NEXTREQ to
490       acknowledge the reception of the batch of rows from a fragment scan.
491       If RNIL, this means that this particular fragment is done scanning.
492     */
493     Uint32 tcPtrI;
494 
495     Uint32 rows;
496     Uint32 len;
497   };
498 
499   /** for 3 word conf */
getLength(Uint32 opDataInfo)500   static Uint32 getLength(Uint32 opDataInfo) { return opDataInfo >> 10; }
getRows(Uint32 opDataInfo)501   static Uint32 getRows(Uint32 opDataInfo) { return opDataInfo & 1023;}
502 };
503 
504 /**
505  * request info
506  *
507  o = received operations        - 8  Bits -> Max 255 (Bit 0-7)
508  e = end of data                - 1  bit (31)
509 
510            1111111111222222222233
511  01234567890123456789012345678901
512  oooooooo                       e
513 */
514 
515 #define OPERATIONS_SHIFT     (0)
516 #define OPERATIONS_MASK      (0xFF)
517 
518 #define STATUS_SHIFT     (8)
519 #define STATUS_MASK      (0xFF)
520 
521 
522 /**
523  *
524  * SENDER:  Dbtc
525  * RECIVER: API
526  */
527 class ScanTabRef {
528   /**
529    * Reciver(s)
530    */
531   friend class NdbTransaction;         // Reciver
532 
533   /**
534    * Sender(s)
535    */
536   friend class Dbtc;
537 
538   /**
539    * For printing
540    */
541   friend bool printSCANTABREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
542 
543 public:
544   /**
545    * Length of signal
546    */
547   STATIC_CONST( SignalLength = 5 );
548 
549 private:
550 
551   // Type definitions
552 
553   /**
554    * DATA VARIABLES
555    */
556   UintR apiConnectPtr;        // DATA 0
557   UintR transId1;             // DATA 1
558   UintR transId2;             // DATA 2
559   UintR errorCode;            // DATA 3
560   UintR closeNeeded;          // DATA 4
561 
562 };
563 
564 /*
565   SENDER:  API
566   RECIVER: Dbtc
567 
568   This signal is sent by API to acknowledge the reception of batches of rows
569   from one or more fragment scans, and to request the fetching of the next
570   batches of rows.
571 
572   Any locks held by the transaction on rows in the previously fetched batches
573   are released (unless explicitly transfered to this or another transaction in
574   a TCKEYREQ signal with TakeOverScanFlag set).
575 
576   The fragment scan batches to acknowledge are identified by the tcPtrI words
577   in the list of struct OpData received in ScanTabConf (scan fragment record
578   pointer).
579 
580   The list of scan fragment record pointers is sent as an array of words,
581   inline in the signal if <= 21 words, else as the first section in a long
582   signal.
583  */
584 class ScanNextReq {
585   /**
586    * Reciver(s)
587    */
588   friend class Dbtc;         // Reciver
589 
590   /**
591    * Sender(s)
592    */
593   friend class NdbScanOperation;
594   friend class NdbQueryImpl;
595 
596   /**
597    * For printing
598    */
599   friend bool printSCANNEXTREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
600 
601 public:
602   /**
603    * Length of signal
604    */
605   STATIC_CONST( SignalLength = 4 );
606 
607   /**
608    * Section carrying receiverIds if num receivers > 21
609    */
610   STATIC_CONST( ReceiverIdsSectionNum = 0);
611 
612 private:
613 
614   // Type definitions
615 
616   /**
617    * DATA VARIABLES
618    */
619   UintR apiConnectPtr;        // DATA 0
620   UintR stopScan;             // DATA 1
621   UintR transId1;             // DATA 2
622   UintR transId2;             // DATA 3
623 
624   // stopScan = 1, stop this scan
625 
626   /*
627     After this data comes the list of scan fragment record pointers for the
628     fragment scans to acknowledge, if they fit within the 25 words available
629     in the signal (else they are sent in the first long signal section).
630   */
631 };
632 
633 
634 #undef JAM_FILE_ID
635 
636 #endif
637