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

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

#include <NdbIndexOperation.hpp>

Inheritance diagram for NdbIndexOperation:
Collaboration diagram for NdbIndexOperation:

Public Member Functions

Define Standard Operation
int insertTuple ()
int readTuple (LockMode)
int readTuple ()
int readTupleExclusive ()
int simpleRead ()
int dirtyRead ()
int committedRead ()
int updateTuple ()
int deleteTuple ()
const NdbDictionary::IndexgetIndex () const
int dirtyUpdate ()
Define Interpreted Program Operation
int interpretedUpdateTuple ()
int interpretedDeleteTuple ()
- Public Member Functions inherited from NdbOperation
LockMode getLockMode () const
AbortOption getAbortOption () const
int setAbortOption (AbortOption)
virtual NdbTransactiongetNdbTransaction () const
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)
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)
virtual NdbBlobgetBlobHandle (Uint32 anAttrId)
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 writeTuple ()
virtual int dirtyWrite ()

Friends

class Ndb
class NdbTransaction
struct Ndb_free_list_t< NdbIndexOperation >

Additional Inherited Members

- 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 }
- 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 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 *)
virtual void release ()
void postExecuteRelease ()
void setStartIndicator ()
int doSendKeyReq (int processorId, GenericSectionPtr *secs, Uint32 numSecs)
int doSend (int ProcessorId, Uint32 lastFlag)
virtual int prepareSend (Uint32 TC_ConnectPtr, Uint64 TransactionId, AbortOption)
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)
virtual NdbRecAttrgetValue_impl (const NdbColumnImpl *, char *aValue=0)
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 ()
virtual void setErrorCode (int aErrorCode) const
virtual void setErrorCodeAbort (int aErrorCode) const
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)
- Static Protected Member Functions inherited from NdbOperation
static int handleOperationOptions (const OperationType type, const OperationOptions *opts, const Uint32 sizeOfOptions, NdbOperation *op)
- 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

Detailed Description

Class of index operations for use in transactions.

Definition at line 30 of file NdbIndexOperation.hpp.

Member Function Documentation

int NdbIndexOperation::committedRead ( )
virtual

Define the NdbOperation to be a standard operation of type committedRead. When calling NdbTransaction::execute, this operation read latest committed value of the record.

This means that if another transaction is updating the record, then the current transaction will not wait. It will instead use the latest committed value of the record.

Returns
0 if successful otherwise -1.

Reimplemented from NdbOperation.

Definition at line 129 of file NdbIndexOperation.cpp.

Here is the call graph for this function:

int NdbIndexOperation::deleteTuple ( )
virtual

Define the NdbIndexOperation to be a standard operation of type deleteTuple.

When calling NdbTransaction::execute, this operation deletes a tuple.

Returns
0 if successful otherwise -1.

Reimplemented from NdbOperation.

Definition at line 143 of file NdbIndexOperation.cpp.

int NdbIndexOperation::dirtyRead ( )
virtual

Define the NdbOperation to be a standard operation of type committedRead. When calling NdbTransaction::execute, this operation read latest committed value of the record.

This means that if another transaction is updating the record, then the current transaction will not wait. It will instead use the latest committed value of the record.

Returns
0 if successful otherwise -1.

Reimplemented from NdbOperation.

Definition at line 122 of file NdbIndexOperation.cpp.

Here is the call graph for this function:

int NdbIndexOperation::dirtyUpdate ( )
virtual

Define the NdbIndexOperation to be a standard operation of type dirtyUpdate.

When calling NdbTransaction::execute, this operation updates without two-phase commit.

Returns
0 if successful otherwise -1.

Reimplemented from NdbOperation.

Definition at line 150 of file NdbIndexOperation.cpp.

const NdbDictionary::Index * NdbIndexOperation::getIndex ( ) const

Get index object for this operation

Definition at line 172 of file NdbIndexOperation.cpp.

int NdbIndexOperation::insertTuple ( )
virtual

insert is not allowed

Reimplemented from NdbOperation.

Definition at line 95 of file NdbIndexOperation.cpp.

int NdbIndexOperation::interpretedDeleteTuple ( )
virtual

Delete a tuple using an interpreted program.

Returns
0 if successful otherwise -1.

Reimplemented from NdbOperation.

Definition at line 164 of file NdbIndexOperation.cpp.

int NdbIndexOperation::interpretedUpdateTuple ( )
virtual

Update a tuple using an interpreted program.

Returns
0 if successful otherwise -1.

Reimplemented from NdbOperation.

Definition at line 157 of file NdbIndexOperation.cpp.

int NdbIndexOperation::readTuple ( NdbOperation::LockMode  lm)
virtual

Define the NdbIndexOperation to be a standard operation of type readTuple. When calling NdbTransaction::execute, this operation reads a tuple.

Returns
0 if successful otherwise -1.

Reimplemented from NdbOperation.

Definition at line 75 of file NdbIndexOperation.cpp.

Here is the call graph for this function:

int NdbIndexOperation::readTuple ( )
virtual

Define the NdbIndexOperation to be a standard operation of type readTuple. When calling NdbTransaction::execute, this operation reads a tuple.

Returns
0 if successful otherwise -1.

Reimplemented from NdbOperation.

Definition at line 101 of file NdbIndexOperation.cpp.

Here is the caller graph for this function:

int NdbIndexOperation::readTupleExclusive ( )
virtual

Define the NdbIndexOperation to be a standard operation of type readTupleExclusive. When calling NdbTransaction::execute, this operation read a tuple using an exclusive lock.

Returns
0 if successful otherwise -1.

Reimplemented from NdbOperation.

Definition at line 108 of file NdbIndexOperation.cpp.

Here is the caller graph for this function:

int NdbIndexOperation::simpleRead ( )
virtual

Define the NdbIndexOperation to be a standard operation of type simpleRead. When calling NdbTransaction::execute, this operation reads an existing tuple (using shared read lock), but releases lock immediately after read.

Note
Using this operation twice in the same transaction may produce different results (e.g. if there is another transaction which updates the value between the simple reads).

Note that simpleRead can read the value from any database node while standard read always read the value on the database node which is primary for the record.

Returns
0 if successful otherwise -1.

Reimplemented from NdbOperation.

Definition at line 115 of file NdbIndexOperation.cpp.

Here is the call graph for this function:

int NdbIndexOperation::updateTuple ( )
virtual

Define the NdbIndexOperation to be a standard operation of type updateTuple.

When calling NdbTransaction::execute, this operation updates a tuple in the table.

Returns
0 if successful otherwise -1.

Reimplemented from NdbOperation.

Definition at line 136 of file NdbIndexOperation.cpp.

Friends And Related Function Documentation

friend class Ndb
friend

Reciver(s)

Definition at line 33 of file NdbIndexOperation.hpp.


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