MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NdbScanOperation Class Reference

Class of scan operations for use in transactions. More...

#include <NdbScanOperation.hpp>

Inheritance diagram for NdbScanOperation:
Collaboration diagram for NdbScanOperation:

Classes

struct  ScanOptions
struct  ScanOptions_v1

Public Types

enum  ScanFlag {
  SF_TupScan = (1 << 16), SF_DiskScan = (2 << 16), SF_OrderBy = (1 << 24), SF_OrderByFull = (16 << 24),
  SF_Descending = (2 << 24), SF_ReadRangeNo = (4 << 24), SF_MultiRange = (8 << 24), SF_KeyInfo = 1
}
- Public Types inherited from NdbOperation
enum  OperationType {
  ReadRequest = 0, UpdateRequest = 1, InsertRequest = 2, DeleteRequest = 3,
  WriteRequest = 4, ReadExclusive = 5, RefreshRequest = 6, UnlockRequest = 7,
  OpenScanRequest, OpenRangeScanRequest, NotDefined2, NotDefined
}
enum  Type { PrimaryKeyAccess = 0, UniqueIndexAccess = 1, TableScan = 2, OrderedIndexScan = 3 }
enum  LockMode {
  LM_Read = 0, LM_Exclusive = 1, LM_CommittedRead = 2, LM_Dirty = 2,
  LM_SimpleRead = 3
}
enum  AbortOption { DefaultAbortOption = -1, AbortOnError = 0, AO_IgnoreError = 2 }

Public Member Functions

virtual int readTuples (LockMode lock_mode=LM_Read, Uint32 scan_flags=0, Uint32 parallel=0, Uint32 batch=0)
int readTuples (int parallell)
int readTuplesExclusive (int parallell=0)
virtual NdbBlobgetBlobHandle (const char *anAttrName)
virtual NdbBlobgetBlobHandle (Uint32 anAttrId)
int setInterpretedCode (const NdbInterpretedCode *code)
int nextResult (bool fetchAllowed=true, bool forceSend=false)
int nextResult (const char **out_row_ptr, bool fetchAllowed, bool forceSend)
int nextResultCopyOut (char *buffer, bool fetchAllowed, bool forceSend)
void close (bool forceSend=false, bool releaseOp=false)
NdbOperationlockCurrentTuple ()
NdbOperationlockCurrentTuple (NdbTransaction *lockTrans)
NdbOperationupdateCurrentTuple ()
NdbOperationupdateCurrentTuple (NdbTransaction *updateTrans)
int deleteCurrentTuple ()
int deleteCurrentTuple (NdbTransaction *takeOverTransaction)
const NdbOperationlockCurrentTuple (NdbTransaction *takeOverTrans, const NdbRecord *result_rec, char *result_row=0, const unsigned char *result_mask=0, const NdbOperation::OperationOptions *opts=0, Uint32 sizeOfOptions=0)
const NdbOperationupdateCurrentTuple (NdbTransaction *takeOverTrans, const NdbRecord *attr_rec, const char *attr_row, const unsigned char *mask=0, const NdbOperation::OperationOptions *opts=0, Uint32 sizeOfOptions=0)
const NdbOperationdeleteCurrentTuple (NdbTransaction *takeOverTrans, const NdbRecord *result_rec, char *result_row=0, const unsigned char *result_mask=0, const NdbOperation::OperationOptions *opts=0, Uint32 sizeOfOptions=0)
NdbTransactiongetNdbTransaction () const
bool getPruned () const
- Public Member Functions inherited from NdbOperation
LockMode getLockMode () const
AbortOption getAbortOption () const
int setAbortOption (AbortOption)
void setPartitionId (Uint32 id)
Uint32 getPartitionId () const
const NdbLockHandlegetLockHandle () const
const NdbLockHandlegetLockHandle ()
const NdbOperationnext () const
const NdbRecAttrgetFirstRecAttr () const
void * getCustomData () const
void setCustomData (void *p)
virtual int interpretedUpdateTuple ()
virtual int interpretedDeleteTuple ()
int equal (const char *anAttrName, const char *aValue, Uint32 len)
int equal (const char *anAttrName, const char *aValue)
int equal (const char *anAttrName, Int32 aValue)
int equal (const char *anAttrName, Uint32 aValue)
int equal (const char *anAttrName, Int64 aValue)
int equal (const char *anAttrName, Uint64 aValue)
int equal (Uint32 anAttrId, const char *aValue, Uint32 len)
int equal (Uint32 anAttrId, const char *aValue)
int equal (Uint32 anAttrId, Int32 aValue)
int equal (Uint32 anAttrId, Uint32 aValue)
int equal (Uint32 anAttrId, Int64 aValue)
int equal (Uint32 anAttrId, Uint64 aValue)
NdbRecAttrgetValue (const char *anAttrName, char *aValue=0)
NdbRecAttrgetValue (Uint32 anAttrId, char *aValue=0)
NdbRecAttrgetValue (const NdbDictionary::Column *, char *val=0)
int setValue (const char *anAttrName, const char *aValue, Uint32 len)
int setValue (const char *anAttrName, const char *aValue)
int setValue (const char *anAttrName, Int32 aValue)
int setValue (const char *anAttrName, Uint32 aValue)
int setValue (const char *anAttrName, Int64 aValue)
int setValue (const char *anAttrName, Uint64 aValue)
int setValue (const char *anAttrName, float aValue)
int setValue (const char *anAttrName, double aValue)
int setAnyValue (Uint32 aValue)
int setOptimize (Uint32 options)
int setValue (Uint32 anAttrId, const char *aValue, Uint32 len)
int setValue (Uint32 anAttrId, const char *aValue)
int setValue (Uint32 anAttrId, Int32 aValue)
int setValue (Uint32 anAttrId, Uint32 aValue)
int setValue (Uint32 anAttrId, Int64 aValue)
int setValue (Uint32 anAttrId, Uint64 aValue)
int setValue (Uint32 anAttrId, float aValue)
int setValue (Uint32 anAttrId, double aValue)
virtual NdbBlobgetBlobHandle (const char *anAttrName) const
virtual NdbBlobgetBlobHandle (Uint32 anAttrId) const
int incValue (const char *anAttrName, Uint32 aValue)
int incValue (const char *anAttrName, Uint64 aValue)
int incValue (Uint32 anAttrId, Uint32 aValue)
int incValue (Uint32 anAttrId, Uint64 aValue)
int subValue (const char *anAttrName, Uint32 aValue)
int subValue (const char *anAttrName, Uint64 aValue)
int subValue (Uint32 anAttrId, Uint32 aValue)
int subValue (Uint32 anAttrId, Uint64 aValue)
int def_label (int labelNumber)
int add_reg (Uint32 RegSource1, Uint32 RegSource2, Uint32 RegDest)
int sub_reg (Uint32 RegSource1, Uint32 RegSource2, Uint32 RegDest)
int load_const_u32 (Uint32 RegDest, Uint32 Constant)
int load_const_u64 (Uint32 RegDest, Uint64 Constant)
int load_const_null (Uint32 RegDest)
int read_attr (const char *anAttrName, Uint32 RegDest)
int write_attr (const char *anAttrName, Uint32 RegSource)
int read_attr (Uint32 anAttrId, Uint32 RegDest)
int write_attr (Uint32 anAttrId, Uint32 RegSource)
int branch_ge (Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
int branch_gt (Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
int branch_le (Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
int branch_lt (Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
int branch_eq (Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
int branch_ne (Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
int branch_ne_null (Uint32 RegLvalue, Uint32 Label)
int branch_eq_null (Uint32 RegLvalue, Uint32 Label)
int branch_label (Uint32 Label)
int branch_col_eq_null (Uint32 ColId, Uint32 Label)
int branch_col_ne_null (Uint32 ColId, Uint32 Label)
int branch_col_eq (Uint32 ColId, const void *val, Uint32 len, bool nopad, Uint32 Label)
int branch_col_ne (Uint32 ColId, const void *val, Uint32 len, bool nopad, Uint32 Label)
int branch_col_lt (Uint32 ColId, const void *val, Uint32 len, bool nopad, Uint32 Label)
int branch_col_le (Uint32 ColId, const void *val, Uint32 len, bool nopad, Uint32 Label)
int branch_col_gt (Uint32 ColId, const void *val, Uint32 len, bool nopad, Uint32 Label)
int branch_col_ge (Uint32 ColId, const void *val, Uint32 len, bool nopad, Uint32 Label)
int branch_col_like (Uint32 ColId, const void *, Uint32 len, bool nopad, Uint32 Label)
int branch_col_notlike (Uint32 ColId, const void *, Uint32 len, bool nopad, Uint32 Label)
int branch_col_and_mask_eq_mask (Uint32 ColId, const void *, Uint32 len, bool nopad, Uint32 Label)
int branch_col_and_mask_ne_mask (Uint32 ColId, const void *, Uint32 len, bool nopad, Uint32 Label)
int branch_col_and_mask_eq_zero (Uint32 ColId, const void *, Uint32 len, bool nopad, Uint32 Label)
int branch_col_and_mask_ne_zero (Uint32 ColId, const void *, Uint32 len, bool nopad, Uint32 Label)
int interpret_exit_ok ()
int interpret_exit_nok (Uint32 ErrorCode)
int interpret_exit_nok ()
int interpret_exit_last_row ()
int def_subroutine (int SubroutineNumber)
int call_sub (Uint32 Subroutine)
int ret_sub ()
const NdbErrorgetNdbError () const
int getNdbErrorLine ()
int getNdbErrorLine () const
const char * getTableName () const
const NdbDictionary::TablegetTable () const
Type getType () const
virtual int insertTuple ()
virtual int updateTuple ()
virtual int writeTuple ()
virtual int deleteTuple ()
virtual int readTuple (LockMode)
virtual int readTuple ()
virtual int readTupleExclusive ()
virtual int simpleRead ()
virtual int dirtyRead ()
virtual int committedRead ()
virtual int dirtyUpdate ()
virtual int dirtyWrite ()

Protected Types

enum  ScanPruningState { SPS_UNKNOWN, SPS_FIXED, SPS_ONE_PARTITION, SPS_MULTI_PARTITION }
- Protected Types inherited from NdbOperation
enum  OperationStatus {
  Init, OperationDefined, TupleKeyDefined, GetValue,
  SetValue, ExecInterpretedValue, SetValueInterpreted, FinalGetValue,
  SubroutineExec, SubroutineEnd, WaitResponse, Finished,
  UseNdbRecord
}
enum  OP_FLAGS { OF_NO_DISK = 0x1, OF_USE_ANY_VALUE = 0x2, OF_QUEUEABLE = 0x4, OF_DEFERRED_CONSTRAINTS = 0x8 }

Protected Member Functions

 NdbScanOperation (Ndb *aNdb, NdbOperation::Type aType=NdbOperation::TableScan)
virtual NdbRecAttrgetValue_impl (const NdbColumnImpl *, char *aValue=0)
NdbRecAttrgetValue_NdbRecord_scan (const NdbColumnImpl *, char *aValue)
NdbRecAttrgetValue_NdbRecAttr_scan (const NdbColumnImpl *, char *aValue)
int handleScanGetValuesOldApi ()
int addInterpretedCode ()
int handleScanOptionsVersion (const ScanOptions *&optionsPtr, Uint32 sizeOfOptions, ScanOptions &currOptions)
int handleScanOptions (const ScanOptions *options)
int validatePartInfoPtr (const Ndb::PartitionSpec *&partInfo, Uint32 sizeOfPartInfo, Ndb::PartitionSpec &partValue)
int getPartValueFromInfo (const Ndb::PartitionSpec *partInfo, const NdbTableImpl *table, Uint32 *partValue)
int generatePackedReadAIs (const NdbRecord *reseult_record, bool &haveBlob, const Uint32 *readMask)
int scanImpl (const NdbScanOperation::ScanOptions *options, const Uint32 *readMask)
int scanTableImpl (const NdbRecord *result_record, NdbOperation::LockMode lock_mode, const unsigned char *result_mask, const NdbScanOperation::ScanOptions *options, Uint32 sizeOfOptions)
int nextResultNdbRecord (const char *&out_row, bool fetchAllowed, bool forceSend)
virtual void release ()
int close_impl (bool forceSend, PollGuard *poll_guard)
NdbInterpretedCodeallocInterpretedCodeOldApi ()
void freeInterpretedCodeOldApi ()
int doSendSetAISectionSizes ()
int executeCursor (int ProcessorId)
int init (const NdbTableImpl *tab, NdbTransaction *)
int prepareSend (Uint32 TC_ConnectPtr, Uint64 TransactionId, NdbOperation::AbortOption)
int doSend (int ProcessorId)
virtual void setReadLockMode (LockMode lockMode)
virtual void setErrorCode (int aErrorCode) const
virtual void setErrorCodeAbort (int aErrorCode) const
int getFirstATTRINFOScan ()
int doSendScan (int ProcessorId)
int finaliseScanOldApi ()
int prepareSendScan (Uint32 TC_ConnectPtr, Uint64 TransactionId)
int fix_receivers (Uint32 parallel)
void reset_receivers (Uint32 parallel, Uint32 ordered)
int send_next_scan (Uint32 cnt, bool close)
void receiver_delivered (NdbReceiver *)
void receiver_completed (NdbReceiver *)
void execCLOSE_SCAN_REP ()
int getKeyFromKEYINFO20 (Uint32 *data, Uint32 &size)
NdbOperationtakeOverScanOp (OperationType opType, NdbTransaction *)
NdbOperationtakeOverScanOpNdbRecord (OperationType opType, NdbTransaction *pTrans, const NdbRecord *record, char *row, const unsigned char *mask, const NdbOperation::OperationOptions *opts, Uint32 sizeOfOptions)
virtual int processTableScanDefs (LockMode lock_mode, Uint32 scan_flags, Uint32 parallel, Uint32 batch)
- Protected Member Functions inherited from NdbOperation
bool needReply ()
int init (const class NdbTableImpl *, NdbTransaction *aCon, bool useRec)
void initInterpreter ()
 NdbOperation (Ndb *aNdb, Type aType=PrimaryKeyAccess)
void next (NdbOperation *)
NdbOperationnext ()
OperationStatus Status ()
void Status (OperationStatus)
void NdbCon (NdbTransaction *)
void postExecuteRelease ()
void setStartIndicator ()
int doSendKeyReq (int processorId, GenericSectionPtr *secs, Uint32 numSecs)
int doSend (int ProcessorId, Uint32 lastFlag)
virtual void setLastFlag (NdbApiSignal *signal, Uint32 lastFlag)
int prepareSendInterpreted ()
int initInterpretedInfo (const NdbInterpretedCode *code, Uint32 *&interpretedInfo, Uint32 *stackSpace, Uint32 stackSpaceEntries, Uint32 *&dynamicSpace)
void freeInterpretedInfo (Uint32 *&dynamicSpace)
int buildInterpretedProgramSignals (Uint32 aTC_ConnectPtr, Uint64 aTransId, Uint32 **attrInfoPtr, Uint32 *remain, const NdbInterpretedCode *code, Uint32 *interpretedWorkspace, bool mainProgram, Uint32 &wordsWritten)
int buildSignalsNdbRecord (Uint32 aTC_ConnectPtr, Uint64 aTransId, const Uint32 *read_mask)
int prepareSendNdbRecord (AbortOption ao)
Uint32 fillTcKeyReqHdr (TcKeyReq *tcKeyReq, Uint32 connectPtr, Uint64 transId)
int allocKeyInfo ()
int allocAttrInfo ()
int insertKEYINFO_NdbRecord (const char *value, Uint32 byteSize)
int insertATTRINFOHdr_NdbRecord (Uint32 attrId, Uint32 attrLen)
int insertATTRINFOData_NdbRecord (const char *value, Uint32 size)
int receiveTCKEYREF (const NdbApiSignal *)
int checkMagicNumber (bool b=true)
int checkState_TransId (const NdbApiSignal *aSignal)
virtual int equal_impl (const NdbColumnImpl *, const char *aValue)
NdbRecAttrgetValue_NdbRecord (const NdbColumnImpl *tAttrInfo, char *aValue)
int setValue (const NdbColumnImpl *anAttrObject, const char *aValue)
NdbBlobgetBlobHandle (NdbTransaction *aCon, const NdbColumnImpl *anAttrObject)
NdbBlobgetBlobHandle (NdbTransaction *aCon, const NdbColumnImpl *anAttrObject) const
int incValue (const NdbColumnImpl *anAttrObject, Uint32 aValue)
int incValue (const NdbColumnImpl *anAttrObject, Uint64 aValue)
int subValue (const NdbColumnImpl *anAttrObject, Uint32 aValue)
int subValue (const NdbColumnImpl *anAttrObject, Uint64 aValue)
int read_attr (const NdbColumnImpl *anAttrObject, Uint32 RegDest)
int write_attr (const NdbColumnImpl *anAttrObject, Uint32 RegSource)
int branch_reg_reg (Uint32 type, Uint32, Uint32, Uint32)
int branch_col (Uint32 type, Uint32, const void *, Uint32, Uint32 Label)
int branch_col_null (Uint32 type, Uint32 col, Uint32 Label)
NdbBloblinkInBlobHandle (NdbTransaction *aCon, const NdbColumnImpl *column, NdbBlob *&lastPtr)
int getBlobHandlesNdbRecord (NdbTransaction *aCon, const Uint32 *mask)
int getBlobHandlesNdbRecordDelete (NdbTransaction *aCon, bool checkReadSet, const Uint32 *mask)
int insertATTRINFO (Uint32 aData)
int insertATTRINFOloop (const Uint32 *aDataPtr, Uint32 aLength)
int insertKEYINFO (const char *aValue, Uint32 aStartPosition, Uint32 aKeyLenInByte)
void reorderKEYINFO ()
bool isNdbRecordOperation ()
int incCheck (const NdbColumnImpl *anAttrObject)
int initial_interpreterCheck ()
int intermediate_interpreterCheck ()
int read_attrCheck (const NdbColumnImpl *anAttrObject)
int write_attrCheck (const NdbColumnImpl *anAttrObject)
int labelCheck ()
int insertCall (Uint32 aCall)
int insertBranch (Uint32 aBranch)
Uint32 ptr2int ()
Uint32 ptr2int () const
int getKeyFromTCREQ (Uint32 *data, Uint32 &size)
int getLockHandleImpl ()
int prepareGetLockHandle ()
int prepareGetLockHandleNdbRecord ()
virtual void setReadLockMode (LockMode lockMode)
NdbRecAttrgetVarValue (const NdbColumnImpl *, char *aBareValue, Uint16 *aLenLoc)
int setVarValue (const NdbColumnImpl *, const char *aBareValue, const Uint16 &aLen)
Uint32 repack_read (Uint32 len)

Protected Attributes

NdbTransactionm_transConnection
Uint32 theParallelism
Uint32 m_keyInfo
Uint32 * m_array
Uint32 m_allocated_receivers
NdbReceiver ** m_receivers
Uint32 * m_prepared_receivers
Uint32 m_current_api_receiver
Uint32 m_api_receivers_count
NdbReceiver ** m_api_receivers
Uint32 m_conf_receivers_count
NdbReceiver ** m_conf_receivers
Uint32 m_sent_receivers_count
NdbReceiver ** m_sent_receivers
bool m_ordered
bool m_descending
Uint32 m_read_range_no
NdbRecAttrm_curr_row
bool m_multi_range
bool m_executed
char * m_scan_buffer
bool m_scanUsingOldApi
bool m_readTuplesCalled
LockMode m_savedLockModeOldApi
Uint32 m_savedScanFlagsOldApi
Uint32 m_savedParallelOldApi
Uint32 m_savedBatchOldApi
NdbInterpretedCodem_interpretedCodeOldApi
ScanPruningState m_pruneState
Uint32 m_pruningKey
- Protected Attributes inherited from NdbOperation
void * m_customData
Type m_type
NdbReceiver theReceiver
NdbError theError
int theErrorLine
NdbtheNdb
NdbTransactiontheNdbCon
NdbOperationtheNext
union {
   NdbApiSignal *   theTCREQ
   NdbApiSignal *   theSCAN_TABREQ
   NdbApiSignal *   theRequest
}; 
NdbApiSignaltheFirstATTRINFO
NdbApiSignaltheCurrentATTRINFO
Uint32 theTotalCurrAI_Len
Uint32 theAI_LenInCurrAI
NdbApiSignaltheLastKEYINFO
class NdbLabeltheFirstLabel
class NdbLabeltheLastLabel
class NdbBranchtheFirstBranch
class NdbBranchtheLastBranch
class NdbCalltheFirstCall
class NdbCalltheLastCall
class NdbSubroutinetheFirstSubroutine
class NdbSubroutinetheLastSubroutine
Uint32 theNoOfLabels
Uint32 theNoOfSubroutines
Uint32 * theKEYINFOptr
Uint32 keyInfoRemain
Uint32 * theATTRINFOptr
Uint32 attrInfoRemain
class NdbTableImplm_currentTable
class NdbTableImplm_accessTable
Uint32 theTupleKeyDefined [NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY][3]
Uint32 theTotalNrOfKeyWordInSignal
Uint32 theTupKeyLen
Uint8 theNoOfTupKeyLeft
OperationType theOperationType
LockMode theLockMode
OperationStatus theStatus
Uint32 theMagicNumber
Uint32 theScanInfo
Uint32 theDistributionKey
Uint32 theSubroutineSize
Uint32 theInitialReadSize
Uint32 theInterpretedSize
Uint32 theFinalUpdateSize
Uint32 theFinalReadSize
Uint8 theStartIndicator
Uint8 theCommitIndicator
Uint8 theSimpleIndicator
Uint8 theDirtyIndicator
Uint8 theInterpretIndicator
Int8 theDistrKeyIndicator_
Uint8 m_flags
Uint8 _unused1
Uint16 m_tcReqGSN
Uint16 m_keyInfoGSN
Uint16 m_attrInfoGSN
const NdbRecordm_key_record
const char * m_key_row
Uint32 m_keyinfo_length
const NdbRecordm_attribute_record
const char * m_attribute_row
Uint32 m_unused_read_mask [(128+31)>>5]
const NdbInterpretedCodem_interpreted_code
const SetValueSpecm_extraSetValues
Uint32 m_numExtraSetValues
Uint32 m_any_value
NdbBlobtheBlobList
Int8 m_abortOption
Int8 m_noErrorPropagation
NdbLockHandletheLockHandle
bool m_blob_lock_upgraded

Friends

class Ndb
class NdbTransaction
class NdbResultSet
class NdbOperation
class NdbBlob
class NdbScanFilter
class NdbQueryOperationImpl

Additional Inherited Members

- Static Protected Member Functions inherited from NdbOperation
static int handleOperationOptions (const OperationType type, const OperationOptions *opts, const Uint32 sizeOfOptions, NdbOperation *op)

Detailed Description

Class of scan operations for use in transactions.

Definition at line 31 of file NdbScanOperation.hpp.

Member Enumeration Documentation

Scan flags. OR-ed together and passed as second argument to readTuples. Note that SF_MultiRange has to be set if several ranges (bounds) are to be passed.

Enumerator:
SF_OrderByFull 

Same as order by, except that it will automatically add all key columns into the read-mask

Definition at line 48 of file NdbScanOperation.hpp.

Member Function Documentation

void NdbScanOperation::close ( bool  forceSend = false,
bool  releaseOp = false 
)

Close scan

Not executed yet

Definition at line 2050 of file NdbScanOperation.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int NdbScanOperation::close_impl ( bool  forceSend,
PollGuard poll_guard 
)
protected

Wait for outstanding

move all conf'ed into api so that send_next_scan can check if they needs to be closed

Ordered scan, keep the m_api_receivers "to the right"

There's something to close setup m_api_receivers (for send_next_scan)

wait for close scan conf

Definition at line 3837 of file NdbScanOperation.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int NdbScanOperation::deleteCurrentTuple ( )
inline

Delete current tuple

Returns
0 on success or -1 on failure

Definition at line 719 of file NdbScanOperation.hpp.

int NdbScanOperation::deleteCurrentTuple ( NdbTransaction takeOverTransaction)
inline

Delete current tuple

Parameters
takeOverTransactionTransaction that should perform the delete
Returns
0 on success or -1 on failure

Definition at line 725 of file NdbScanOperation.hpp.

int NdbScanOperation::executeCursor ( int  ProcessorId)
protected

Set pointers correctly so that nextResult will handle it correctly even if doSendScan was never called bug#42454

Definition at line 1666 of file NdbScanOperation.cpp.

Here is the caller graph for this function:

int NdbScanOperation::generatePackedReadAIs ( const NdbRecord result_record,
bool &  haveBlob,
const Uint32 *  m_read_mask 
)
protected

generatePackedReadAIs This method is adds AttrInfos to the current signal train to perform a packed read of the requested columns. It is used by table scan and index scan.

Definition at line 362 of file NdbScanOperation.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

NdbBlob * NdbScanOperation::getBlobHandle ( const char *  anAttrName)
virtual

This method replaces getValue/setValue for blobs. It creates a blob handle NdbBlob. A second call with same argument returns the previously created handle. The handle is linked to the operation and is maintained automatically.

See NdbBlob for details.

For NdbRecord operation, this method can be used to fetch the blob handle for an NdbRecord operation that references the blob, but extra blob columns can not be added with this call (it will return 0).

For reading with NdbRecord, the NdbRecord entry for each blob must reserve space in the row for sizeof(NdbBlob *). The blob handle will be stored there, providing an alternative way of obtaining the blob handle.

Reimplemented from NdbOperation.

Definition at line 2846 of file NdbScanOperation.cpp.

NdbTransaction * NdbScanOperation::getNdbTransaction ( ) const
inlinevirtual

Get NdbTransaction object for this scan operation

Reimplemented from NdbOperation.

Definition at line 769 of file NdbScanOperation.hpp.

bool NdbScanOperation::getPruned ( ) const

Is scan operation pruned to a single table partition? For NdbRecord defined scans, valid before+after execute. For Old Api defined scans, valid only after execute.

Definition at line 4065 of file NdbScanOperation.cpp.

NdbRecAttr * NdbScanOperation::getValue_NdbRecAttr_scan ( const NdbColumnImpl attrInfo,
char *  aValue 
)
protected

getValue_NdbRecAttr_scan This variant is called when the old Api getValue() method is called against a ScanOperation. It adds a RecAttr object to the scan. Signals to request that the value be read are added when the old Api scan is finalised. This method is not used to process ScanOptions::GETVALUE extra gets

Definition at line 2937 of file NdbScanOperation.cpp.

NdbRecAttr * NdbScanOperation::getValue_NdbRecord_scan ( const NdbColumnImpl attrInfo,
char *  aValue 
)
protected

getValue_NdbRecord_scan This variant is called when the ScanOptions::GETVALUE mechanism is used to add extra GetValues to an NdbRecord defined scan. It is not used for supporting old-Api scans

Definition at line 2900 of file NdbScanOperation.cpp.

NdbOperation * NdbScanOperation::lockCurrentTuple ( )
inline

Lock current tuple

Returns
an NdbOperation or NULL.

Definition at line 693 of file NdbScanOperation.hpp.

NdbOperation * NdbScanOperation::lockCurrentTuple ( NdbTransaction lockTrans)
inline

Lock current tuple

Parameters
lockTransTransaction that should perform the lock
Returns
an NdbOperation or NULL.

Definition at line 699 of file NdbScanOperation.hpp.

int NdbScanOperation::nextResult ( bool  fetchAllowed = true,
bool  forceSend = false 
)

Get the next tuple in a scan transaction.

After each call to nextResult the buffers and NdbRecAttr objects defined in NdbOperation::getValue are updated with values from the scanned tuple.

Parameters
fetchAllowedIf set to false, then fetching is disabled
forceSendIf true send will occur immediately (see Adaptive Send Algorithm)

The NDB API will receive tuples from each fragment in batches, and needs to explicitly request from the NDB Kernel the sending of each new batch. When a new batch is requested, the NDB Kernel will remove any locks taken on rows in the previous batch, unless they have been already taken over by the application executing updateCurrentTuple(), lockCurrentTuple(), etc.

The fetchAllowed parameter is used to control this release of locks from the application. When fetchAllowed is set to false, the NDB API will not request new batches from the NDB Kernel when all received rows have been exhausted, but will instead return 2 from nextResult(), indicating that new batches must be requested. You must then call nextResult with fetchAllowed = true in order to contact the NDB Kernel for more records, after taking over locks as appropriate.

fetchAllowed = false is useful when you want to update or delete all the records fetched in one transaction(This will save a lot of round trip time and make updates or deletes of scanned records a lot faster).

While nextResult(false) returns 0, take over the record to another transaction. When nextResult(false) returns 2 you must execute and commit the other transaction. This will cause the locks to be transferred to the other transaction, updates or deletes will be made and then the locks will be released.

After that, call nextResult(true) which will fetch new records and cache them in the NdbApi.

Note
If you don't take over the records to another transaction the locks on those records will be released the next time NDB Kernel is contacted for more records.
Please contact for examples of efficient scan updates and deletes.
See ndb/examples/ndbapi_scan_example for usage.
Returns
  • -1: if unsuccessful,
  • 0: if another tuple was received, and
  • 1: if there are no more tuples to scan.
  • 2: if there are no more cached records in NdbApi

Definition at line 1744 of file NdbScanOperation.cpp.

Here is the caller graph for this function:

int NdbScanOperation::nextResultNdbRecord ( const char *&  out_row,
bool  fetchAllowed,
bool  forceSend 
)
protected

No completed & no sent -> EndOfData

Definition at line 1834 of file NdbScanOperation.cpp.

Here is the call graph for this function:

int NdbScanOperation::prepareSendScan ( Uint32  TC_ConnectPtr,
Uint64  TransactionId 
)
protected

Prepare all receivers

The number of records sent by each LQH is calculated and the kernel is informed of this number by updating the SCAN_TABREQ signal

Set keyinfo, nodisk and distribution key flags in ScanTabReq (Always request keyinfo when using blobs)

Definition at line 2267 of file NdbScanOperation.cpp.

Here is the caller graph for this function:

virtual int NdbScanOperation::readTuples ( LockMode  lock_mode = LM_Read,
Uint32  scan_flags = 0,
Uint32  parallel = 0,
Uint32  batch = 0 
)
virtual

readTuples Method used in old scan Api to specify scan operation details

Parameters
lock_modeLock mode
scan_flagssee ScanFlag
parallelNumber of fragments to scan in parallel (0=max)
batchNumber of rows to fetch in each batch

Here is the caller graph for this function:

int NdbScanOperation::readTuples ( int  parallell)
inline

readTuples

Parameters
lock_modeLock mode
batchNo of rows to fetch from each fragment at a time
parallelNo of fragments to scan in parallell
Note
specifying 0 for batch and parallel means max performance

Definition at line 193 of file NdbScanOperation.hpp.

Here is the call graph for this function:

void NdbScanOperation::receiver_completed ( NdbReceiver tRec)
protected

Remove receiver as it's completed

Definition at line 1615 of file NdbScanOperation.cpp.

void NdbScanOperation::receiver_delivered ( NdbReceiver tRec)
protected

Move receiver from send array to conf:ed array

Definition at line 1590 of file NdbScanOperation.cpp.

int NdbScanOperation::scanImpl ( const NdbScanOperation::ScanOptions options,
const Uint32 *  readMask 
)
inlineprotected

scanImpl This method is called by scanTableImpl() and scanIndexImpl() and performs most of the signal building tasks that both scan types share

Definition at line 439 of file NdbScanOperation.cpp.

Here is the call graph for this function:

int NdbScanOperation::send_next_scan ( Uint32  cnt,
bool  close 
)
protected

Prepare ops

Definition at line 1978 of file NdbScanOperation.cpp.

Here is the caller graph for this function:

int NdbScanOperation::setInterpretedCode ( const NdbInterpretedCode code)

setInterpretedCode

This method is used to set an interpreted program to be executed against every row returned by the scan. This is used to filter rows out of the returned set. This method is only supported for old Api scans. For NdbRecord scans, pass the interpreted program via the ScanOptions structure.

Parameters
codeThe interpreted program to be executed for each candidate result row in this scan.
Returns
0 if successful, -1 otherwise

Definition at line 1454 of file NdbScanOperation.cpp.

NdbOperation * NdbScanOperation::updateCurrentTuple ( )
inline

Update current tuple

Returns
an NdbOperation or NULL.

Definition at line 706 of file NdbScanOperation.hpp.

Here is the caller graph for this function:

NdbOperation * NdbScanOperation::updateCurrentTuple ( NdbTransaction updateTrans)
inline

Update current tuple

Parameters
updateTransTransaction that should perform the update
Returns
an NdbOperation or NULL.

Definition at line 712 of file NdbScanOperation.hpp.

Friends And Related Function Documentation

friend class Ndb
friend

Reciver(s)

Definition at line 33 of file NdbScanOperation.hpp.

friend class NdbOperation
friend

Sender(s)

Definition at line 36 of file NdbScanOperation.hpp.


The documentation for this class was generated from the following files: