18 #ifndef NdbScanOperation_H
19 #define NdbScanOperation_H
21 #include "NdbOperation.hpp"
32 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
50 SF_TupScan = (1 << 16),
52 SF_DiskScan = (2 << 16),
58 SF_OrderBy = (1 << 24),
66 SF_Descending = (2 << 24),
74 SF_ReadRangeNo = (4 << 24),
76 SF_MultiRange = (8 << 24),
111 Uint64 optionsPresent;
113 enum Type { SO_SCANFLAGS = 0x01,
117 SO_PARTITION_ID = 0x10,
118 SO_INTERPRETED = 0x20,
119 SO_CUSTOMDATA = 0x40,
143 Uint32 numExtraGetValues;
160 Uint32 sizeOfPartInfo;
175 Uint32 scan_flags = 0,
179 #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
187 #ifdef ndb_readtuples_impossible_overload
189 Uint32 batch = 0, Uint32 parallel = 0,
190 bool keyinfo =
false,
bool multi_range =
false);
197 inline int readTuplesExclusive(
int parallell = 0){
207 Uint64 optionsPresent;
209 enum Type { SO_SCANFLAGS = 0x01,
213 SO_PARTITION_ID = 0x10,
214 SO_INTERPRETED = 0x20,
215 SO_CUSTOMDATA = 0x40 };
237 Uint32 numExtraGetValues;
254 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
332 int nextResult(
bool fetchAllowed =
true,
bool forceSend =
false);
366 int nextResultCopyOut(
char * buffer,
373 void close(
bool forceSend =
false,
bool releaseOp =
false);
436 const unsigned char *result_mask= 0,
438 Uint32 sizeOfOptions = 0);
448 const char *attr_row,
449 const unsigned char *mask= 0,
451 Uint32 sizeOfOptions = 0);
460 char *result_row = 0,
461 const unsigned char *result_mask = 0,
463 Uint32 sizeOfOptions = 0);
487 int handleScanGetValuesOldApi();
488 int addInterpretedCode();
489 int handleScanOptionsVersion(
const ScanOptions*& optionsPtr,
490 Uint32 sizeOfOptions,
494 Uint32 sizeOfPartInfo,
500 const Uint32 * readMask);
502 const Uint32 * readMask);
503 int scanTableImpl(
const NdbRecord *result_record,
505 const unsigned char *result_mask,
507 Uint32 sizeOfOptions);
510 bool fetchAllowed,
bool forceSend);
511 virtual void release();
520 void freeInterpretedCodeOldApi();
522 int doSendSetAISectionSizes();
529 int prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId,
531 int doSend(
int ProcessorId);
532 virtual void setReadLockMode(
LockMode lockMode);
534 virtual void setErrorCode(
int aErrorCode)
const;
535 virtual void setErrorCodeAbort(
int aErrorCode)
const;
544 Uint32 theParallelism;
553 int getFirstATTRINFOScan();
554 int doSendScan(
int ProcessorId);
555 int finaliseScanOldApi();
558 int fix_receivers(Uint32 parallel);
559 void reset_receivers(Uint32 parallel, Uint32 ordered);
561 Uint32 m_allocated_receivers;
564 Uint32* m_prepared_receivers;
587 Uint32 m_current_api_receiver;
588 Uint32 m_api_receivers_count;
598 Uint32 m_conf_receivers_count;
607 Uint32 m_sent_receivers_count;
613 void execCLOSE_SCAN_REP();
615 int getKeyFromKEYINFO20(Uint32* data, Uint32 &
size);
621 const unsigned char *mask,
623 Uint32 sizeOfOptions);
626 Uint32 m_read_range_no;
644 virtual int processTableScanDefs(
LockMode lock_mode,
650 bool m_scanUsingOldApi;
653 bool m_readTuplesCalled;
657 Uint32 m_savedScanFlagsOldApi;
658 Uint32 m_savedParallelOldApi;
659 Uint32 m_savedBatchOldApi;
666 enum ScanPruningState {
673 ScanPruningState m_pruneState;
737 const char *attr_row,
738 const unsigned char *mask,
740 Uint32 sizeOfOptions)
749 attr_rec, (
char *)attr_row, mask,
750 opts, sizeOfOptions);
758 const unsigned char *result_mask,
760 Uint32 sizeOfOptions)
763 result_rec, result_row, result_mask,
764 opts, sizeOfOptions);
774 return m_transConnection;