MySQL 5.6.14 Source Code Document
|
Class of operations for use in transactions. More...
#include <NdbOperation.hpp>
Classes | |
struct | GetValueSpec |
struct | OperationOptions |
struct | SetValueSpec |
Public Types | |
enum | OperationType { ReadRequest = 0, UpdateRequest = 1, InsertRequest = 2, DeleteRequest = 3, WriteRequest = 4, ReadExclusive = 5, RefreshRequest = 6, UnlockRequest = 7, OpenScanRequest, OpenRangeScanRequest, NotDefined2, NotDefined } |
Public Member Functions | |
LockMode | getLockMode () const |
AbortOption | getAbortOption () const |
int | setAbortOption (AbortOption) |
virtual NdbTransaction * | getNdbTransaction () const |
void | setPartitionId (Uint32 id) |
Uint32 | getPartitionId () const |
const NdbLockHandle * | getLockHandle () const |
const NdbLockHandle * | getLockHandle () |
const NdbOperation * | next () const |
const NdbRecAttr * | getFirstRecAttr () const |
void * | getCustomData () const |
void | setCustomData (void *p) |
Define Interpreted Program Operation Type | |
virtual int | interpretedUpdateTuple () |
virtual int | interpretedDeleteTuple () |
Specify Search Conditions | |
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) |
Specify Attribute Actions for Operations | |
NdbRecAttr * | getValue (const char *anAttrName, char *aValue=0) |
NdbRecAttr * | getValue (Uint32 anAttrId, char *aValue=0) |
NdbRecAttr * | getValue (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 NdbBlob * | getBlobHandle (const char *anAttrName) |
virtual NdbBlob * | getBlobHandle (Uint32 anAttrId) |
virtual NdbBlob * | getBlobHandle (const char *anAttrName) const |
virtual NdbBlob * | getBlobHandle (Uint32 anAttrId) const |
Specify Interpreted Program Instructions | |
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 () |
Error Handling | |
const NdbError & | getNdbError () const |
int | getNdbErrorLine () |
int | getNdbErrorLine () const |
const char * | getTableName () const |
const NdbDictionary::Table * | getTable () const |
Type | getType () const |
Protected Member Functions | |
bool | needReply () |
int | init (const class NdbTableImpl *, NdbTransaction *aCon, bool useRec) |
void | initInterpreter () |
NdbOperation (Ndb *aNdb, Type aType=PrimaryKeyAccess) | |
void | next (NdbOperation *) |
NdbOperation * | next () |
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 NdbRecAttr * | getValue_impl (const NdbColumnImpl *, char *aValue=0) |
NdbRecAttr * | getValue_NdbRecord (const NdbColumnImpl *tAttrInfo, char *aValue) |
int | setValue (const NdbColumnImpl *anAttrObject, const char *aValue) |
NdbBlob * | getBlobHandle (NdbTransaction *aCon, const NdbColumnImpl *anAttrObject) |
NdbBlob * | getBlobHandle (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) |
NdbBlob * | linkInBlobHandle (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) |
NdbRecAttr * | getVarValue (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 | |
static int | handleOperationOptions (const OperationType type, const OperationOptions *opts, const Uint32 sizeOfOptions, NdbOperation *op) |
Protected Attributes | |
void * | m_customData |
Type | m_type |
NdbReceiver | theReceiver |
NdbError | theError |
int | theErrorLine |
Ndb * | theNdb |
NdbTransaction * | theNdbCon |
NdbOperation * | theNext |
union { | |
NdbApiSignal * theTCREQ | |
NdbApiSignal * theSCAN_TABREQ | |
NdbApiSignal * theRequest | |
}; | |
NdbApiSignal * | theFirstATTRINFO |
NdbApiSignal * | theCurrentATTRINFO |
Uint32 | theTotalCurrAI_Len |
Uint32 | theAI_LenInCurrAI |
NdbApiSignal * | theLastKEYINFO |
class NdbLabel * | theFirstLabel |
class NdbLabel * | theLastLabel |
class NdbBranch * | theFirstBranch |
class NdbBranch * | theLastBranch |
class NdbCall * | theFirstCall |
class NdbCall * | theLastCall |
class NdbSubroutine * | theFirstSubroutine |
class NdbSubroutine * | theLastSubroutine |
Uint32 | theNoOfLabels |
Uint32 | theNoOfSubroutines |
Uint32 * | theKEYINFOptr |
Uint32 | keyInfoRemain |
Uint32 * | theATTRINFOptr |
Uint32 | attrInfoRemain |
class NdbTableImpl * | m_currentTable |
class NdbTableImpl * | m_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 NdbRecord * | m_key_record |
const char * | m_key_row |
Uint32 | m_keyinfo_length |
const NdbRecord * | m_attribute_record |
const char * | m_attribute_row |
Uint32 | m_unused_read_mask [(128+31)>>5] |
const NdbInterpretedCode * | m_interpreted_code |
const SetValueSpec * | m_extraSetValues |
Uint32 | m_numExtraSetValues |
Uint32 | m_any_value |
NdbBlob * | theBlobList |
Int8 | m_abortOption |
Int8 | m_noErrorPropagation |
NdbLockHandle * | theLockHandle |
bool | m_blob_lock_upgraded |
Friends | |
class | Ndb |
class | NdbTransaction |
class | NdbScanOperation |
class | NdbScanReceiver |
class | NdbScanFilter |
class | NdbScanFilterImpl |
class | NdbReceiver |
class | NdbBlob |
struct | Ndb_free_list_t< NdbOperation > |
Define Standard Operation Type | |
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 } |
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 () |
Class of operations for use in transactions.
Definition at line 45 of file NdbOperation.hpp.
How should transaction be handled if operation fails.
If AO_IgnoreError, a failure in one operation will not abort the transaction, and NdbTransaction::execute() will return 0 (success). Use NdbOperation::getNdbError() to check for errors from individual operations.
If AbortOnError, a failure in one operation will abort the transaction and cause NdbTransaction::execute() to return -1.
Abort option can be set on execute(), or in the individual operation. Setting AO_IgnoreError or AbortOnError in execute() overrides the settings on individual operations. Setting DefaultAbortOption in execute() (the default) causes individual operation settings to be used.
For READ, default is AO_IgnoreError DML, default is AbortOnError CommittedRead does only support AO_IgnoreError
DefaultAbortOption |
Use default as specified by op-type. |
AbortOnError |
Abort transaction on failed operation. |
AO_IgnoreError |
Transaction continues on failed operation. |
Definition at line 128 of file NdbOperation.hpp.
Lock when performing read
LM_Read |
Read with shared lock. |
LM_Exclusive |
Read with exclusive lock. |
LM_CommittedRead |
Ignore locks, read last committed value. |
LM_SimpleRead |
Read with shared lock, but release lock directly. |
Definition at line 91 of file NdbOperation.hpp.
Type of operation
Definition at line 910 of file NdbOperation.hpp.
enum NdbOperation::Type |
Different access types (supported by sub-classes of NdbOperation)
PrimaryKeyAccess |
Read, insert, update, or delete using pk. |
UniqueIndexAccess |
Read, update, or delete using unique index. |
TableScan |
Full table scan. |
OrderedIndexScan |
Ordered index scan. |
Definition at line 68 of file NdbOperation.hpp.
int NdbOperation::add_reg | ( | Uint32 | RegSource1, |
Uint32 | RegSource2, | ||
Uint32 | RegDest | ||
) |
Interpreted program instruction: Add two registers into a third.
RegSource1 | First register. |
RegSource2 | Second register. |
RegDest | Destination register where the result will be stored. |
Definition at line 636 of file NdbOperationInt.cpp.
int NdbOperation::branch_col_and_mask_eq_mask | ( | Uint32 | ColId, |
const void * | mask, | ||
Uint32 | len, | ||
bool | nopad, | ||
Uint32 | Label | ||
) |
Bitwise logical comparisons
These comparison types are only supported for the Bitfield type They can be used to test for bit patterns in bitfield columns The value passed is a bitmask which is bitwise-ANDed with the column data. Bitfields are passed in/out of NdbApi as 32-bit words with bits set from lsb to msb. The platform's endianness controls which byte contains the ls bits. x86= first(0th) byte. Sparc/PPC= last (3rd byte)
To set bit n of a bitmask to 1 from a Uint32* mask : mask[n >> 5] |= (1 << (n & 31))
The branch can be taken in 4 cases :
Definition at line 1229 of file NdbOperationInt.cpp.
int NdbOperation::branch_col_eq | ( | Uint32 | ColId, |
const void * | val, | ||
Uint32 | len, | ||
bool | nopad, | ||
Uint32 | Label | ||
) |
Interpreted program instruction: branch after memcmp
ColId | column to check |
val | search value |
len | length of search value |
nopad | force non-padded comparison for a Char column |
Label | label to jump to |
Definition at line 1168 of file NdbOperationInt.cpp.
int NdbOperation::branch_col_eq_null | ( | Uint32 | ColId, |
Uint32 | Label | ||
) |
Interpreted program instruction: branch after memcmp
ColId | Column to check |
Label | Label to jump to |
Definition at line 1283 of file NdbOperationInt.cpp.
int NdbOperation::branch_col_like | ( | Uint32 | ColId, |
const void * | val, | ||
Uint32 | len, | ||
bool | nopad, | ||
Uint32 | Label | ||
) |
LIKE/NOTLIKE wildcard comparisons These instructions support SQL-style % and _ wildcards for (VAR)CHAR/BINARY columns only
The argument is always plain char format, even if the field is varchar (changed in 5.0.22).
Definition at line 1213 of file NdbOperationInt.cpp.
int NdbOperation::branch_eq_null | ( | Uint32 | RegLvalue, |
Uint32 | Label | ||
) |
Interpreted program instruction: Jump to Label if RegLvalue is equal to NULL.
RegLvalue | Value to check. |
Label | Label to jump to. |
Definition at line 892 of file NdbOperationInt.cpp.
int NdbOperation::branch_ge | ( | Uint32 | RegLvalue, |
Uint32 | RegRvalue, | ||
Uint32 | Label | ||
) |
Interpreted program instruction: Define a search condition. Last two letters in the function name describes the search condition. The condition compares RegR with RegL and therefore appears to be reversed.
RegLvalue | left value. |
RegRvalue | right value. |
Label | the label to jump to. |
Definition at line 830 of file NdbOperationInt.cpp.
int NdbOperation::branch_label | ( | Uint32 | Label | ) |
Interpreted program instruction: Jump to Label.
Label | Label to jump to. |
Definition at line 906 of file NdbOperationInt.cpp.
int NdbOperation::branch_ne_null | ( | Uint32 | RegLvalue, |
Uint32 | Label | ||
) |
Interpreted program instruction: Jump to Label if RegLvalue is not NULL.
RegLvalue | the value to check. |
Label | the label to jump to. |
Definition at line 878 of file NdbOperationInt.cpp.
int NdbOperation::call_sub | ( | Uint32 | Subroutine | ) |
Interpreted program instruction: Call a subroutine.
Subroutine | the subroutine to call. |
Definition at line 978 of file NdbOperationInt.cpp.
|
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.
Reimplemented in NdbIndexOperation.
Definition at line 215 of file NdbOperationDefine.cpp.
int NdbOperation::def_label | ( | int | labelNumber | ) |
Interpreted program instruction: Define a jump label in an interpreted operation.
labelNumber | Label number. |
Here we set the address that the label should point to (jump address), the first 5 words are excluded since they are length specifications and not part of the data. We need to add 1 to the current ATTRINFO length since the last inserted item is not where we want to jump to. Later on we will update the branch items with this address, this is done in the NdbOperation::prepareSendInterpreted method.
Definition at line 496 of file NdbOperationInt.cpp.
int NdbOperation::def_subroutine | ( | int | SubroutineNumber | ) |
Interpreted program instruction: Define a subroutine in an interpreted operation.
SubroutineNumber | the subroutine number. |
Definition at line 556 of file NdbOperationInt.cpp.
|
virtual |
Define the NdbOperation to be a standard operation of type deleteTuple. When calling NdbTransaction::execute, this operation delete a tuple.
Reimplemented in NdbIndexOperation.
Definition at line 94 of file NdbOperationDefine.cpp.
|
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. dirtyRead is a deprecated name for committedRead
Reimplemented in NdbIndexOperation.
Definition at line 206 of file NdbOperationDefine.cpp.
|
virtual |
Define the NdbOperation to be a standard operation of type dirtyUpdate. When calling NdbTransaction::execute, this operation updates without two-phase commit.
Reimplemented in NdbIndexOperation.
Definition at line 237 of file NdbOperationDefine.cpp.
|
virtual |
Define the NdbOperation to be a standard operation of type dirtyWrite. When calling NdbTransaction::execute, this operation writes without two-phase commit.
Definition at line 261 of file NdbOperationDefine.cpp.
|
inline |
Define a search condition with equality. The condition is true if the attribute has the given value. To set search conditions on multiple attributes, use several equals (then all of them must be satisfied for the tuple to be selected).
anAttrName | Attribute name |
aValue | Attribute value. |
Definition at line 1674 of file NdbOperation.hpp.
NdbOperation::AbortOption NdbOperation::getAbortOption | ( | ) | const |
Get/set abort option
Definition at line 1049 of file NdbOperationDefine.cpp.
|
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 in NdbScanOperation.
Definition at line 395 of file NdbOperation.cpp.
|
inline |
Return lock mode for operation
Definition at line 929 of file NdbOperation.hpp.
const NdbError & NdbOperation::getNdbError | ( | ) | const |
Get the latest error code.
Definition at line 59 of file Ndberr.cpp.
|
inline |
Get the method number where the error occured.
Definition at line 1564 of file NdbOperation.hpp.
|
virtual |
Get NdbTransaction object pointer for this operation
Reimplemented in NdbScanOperation.
Definition at line 546 of file NdbOperation.cpp.
const NdbDictionary::Table * NdbOperation::getTable | ( | ) | const |
Get table object for this operation Not supported for NdbRecord operation.
Definition at line 540 of file NdbOperation.cpp.
const char * NdbOperation::getTableName | ( | ) | const |
Get table name of this operation. Not supported for NdbRecord operation.
Definition at line 534 of file NdbOperation.cpp.
|
inline |
Get the type of access for this operation
Definition at line 1626 of file NdbOperation.hpp.
NdbRecAttr * NdbOperation::getValue | ( | const char * | anAttrName, |
char * | aValue = 0 |
||
) |
Defines a retrieval operation of an attribute value. The NDB API allocate memory for the NdbRecAttr object that will hold the returned attribute value.
anAttrName | Attribute name |
aValue | If this is non-NULL, then the attribute value will be returned in this parameter. If NULL, then the attribute value will only be stored in the returned NdbRecAttr object. |
Definition at line 311 of file NdbOperation.cpp.
int NdbOperation::incValue | ( | const char * | anAttrName, |
Uint32 | aValue | ||
) |
Interpreted program instruction: Add a value to an attribute.
anAttrName | Attribute name. |
aValue | Value to add. |
Definition at line 462 of file NdbOperation.cpp.
|
virtual |
Define the NdbOperation to be a standard operation of type insertTuple. When calling NdbTransaction::execute, this operation adds a new tuple to the table.
Reimplemented in NdbIndexOperation.
Definition at line 31 of file NdbOperationDefine.cpp.
int NdbOperation::interpret_exit_last_row | ( | ) |
Interpreted program instruction:
abort the whole transaction.
Definition at line 936 of file NdbOperationInt.cpp.
int NdbOperation::interpret_exit_nok | ( | Uint32 | ErrorCode | ) |
Interpreted program instruction: Exit with Not Ok
ErrorCode | An error code given by the application programmer. |
Definition at line 952 of file NdbOperationInt.cpp.
int NdbOperation::interpret_exit_ok | ( | ) |
Interpreted program instruction: Exit with Ok
Definition at line 924 of file NdbOperationInt.cpp.
|
virtual |
Delete a tuple using an interpreted program.
Reimplemented in NdbIndexOperation.
Definition at line 309 of file NdbOperationDefine.cpp.
|
virtual |
Update a tuple using an interpreted program.
Reimplemented in NdbIndexOperation.
Definition at line 285 of file NdbOperationDefine.cpp.
int NdbOperation::load_const_null | ( | Uint32 | RegDest | ) |
Interpreted program instruction: Load NULL value into a register.
RegDest | Destination register. |
Definition at line 752 of file NdbOperationInt.cpp.
int NdbOperation::load_const_u32 | ( | Uint32 | RegDest, |
Uint32 | Constant | ||
) |
Interpreted program instruction: Load a constant into a register.
RegDest | Destination register. |
Constant | Value to load. |
Definition at line 700 of file NdbOperationInt.cpp.
|
protectedvirtual |
A dirty read, can not abort the transaction
Set correct length on last KeyInfo signal
Definition at line 386 of file NdbOperationExec.cpp.
int NdbOperation::read_attr | ( | const char * | anAttrName, |
Uint32 | RegDest | ||
) |
Interpreted program instruction: Read an attribute into a register.
anAttrName | Attribute name. |
RegDest | Destination register. |
Definition at line 510 of file NdbOperation.cpp.
int NdbOperation::read_attr | ( | Uint32 | anAttrId, |
Uint32 | RegDest | ||
) |
Interpreted program instruction: Read an attribute into a register.
anAttrId | the attribute id. |
RegDest | the destination register. |
Definition at line 516 of file NdbOperation.cpp.
|
virtual |
Define the NdbOperation to be a standard operation of type readTuple. When calling NdbTransaction::execute, this operation reads a tuple.
Reimplemented in NdbIndexOperation.
Definition at line 116 of file NdbOperationDefine.cpp.
|
virtual |
Define the NdbOperation to be a standard operation of type readTuple. When calling NdbTransaction::execute, this operation reads a tuple.
Reimplemented in NdbIndexOperation.
Definition at line 138 of file NdbOperationDefine.cpp.
|
virtual |
Define the NdbOperation to be a standard operation of type readTupleExclusive. When calling NdbTransaction::execute, this operation read a tuple using an exclusive lock.
Reimplemented in NdbIndexOperation.
Definition at line 160 of file NdbOperationDefine.cpp.
|
protected |
If TCKEYCONF has arrived op has completed (maybe trans has completed)
Definition at line 1737 of file NdbOperationExec.cpp.
int NdbOperation::ret_sub | ( | ) |
Interpreted program instruction: End a subroutine.
Definition at line 992 of file NdbOperationInt.cpp.
void NdbOperation::setPartitionId | ( | Uint32 | id | ) |
Set/get partition key
Definition at line 524 of file NdbOperationSearch.cpp.
|
inline |
Define an attribute to set or update in query.
To set a NULL value, use the following construct:
There are a number of NdbOperation::setValue methods that take a certain type as input (pass by value rather than passing a pointer). As the interface is currently implemented it is the responsibility of the application programmer to use the correct types.
The NDB API will however check that the application sends a correct length to the interface as given in the length parameter. The passing of char* as the value can contain any type or any type of array. If length is not provided or set to zero, then the API will assume that the pointer is correct and not bother with checking it.
anAttrName | Name (or Id) of attribute. |
aValue | Attribute value to set. |
Definition at line 1748 of file NdbOperation.hpp.
|
virtual |
Define the NdbOperation 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 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.
Reimplemented in NdbIndexOperation.
Definition at line 182 of file NdbOperationDefine.cpp.
int NdbOperation::sub_reg | ( | Uint32 | RegSource1, |
Uint32 | RegSource2, | ||
Uint32 | RegDest | ||
) |
Interpreted program instruction: Substract RegSource2 from RegSource1 and put the result in RegDest.
RegSource1 | First register. |
RegSource2 | Second register. |
RegDest | Destination register where the result will be stored. |
Definition at line 668 of file NdbOperationInt.cpp.
int NdbOperation::subValue | ( | const char * | anAttrName, |
Uint32 | aValue | ||
) |
Interpreted program instruction: Subtract a value from an attribute in an interpreted operation.
anAttrName | Attribute name. |
aValue | Value to subtract. |
Definition at line 486 of file NdbOperation.cpp.
|
virtual |
Define the NdbOperation to be a standard operation of type updateTuple. When calling NdbTransaction::execute, this operation updates a tuple in the table.
Reimplemented in NdbIndexOperation.
Definition at line 52 of file NdbOperationDefine.cpp.
int NdbOperation::write_attr | ( | const char * | anAttrName, |
Uint32 | RegSource | ||
) |
Interpreted program instruction: Write an attribute from a register.
anAttrName | Attribute name. |
RegSource | Source register. |
Definition at line 522 of file NdbOperation.cpp.
int NdbOperation::write_attr | ( | Uint32 | anAttrId, |
Uint32 | RegSource | ||
) |
Interpreted program instruction: Write an attribute from a register.
anAttrId | the attribute id. |
RegSource | the source register. |
Definition at line 528 of file NdbOperation.cpp.
|
virtual |
Define the NdbOperation to be a standard operation of type writeTuple. When calling NdbTransaction::execute, this operation writes a tuple to the table. If the tuple exists, it updates it, otherwise an insert takes place.
Definition at line 73 of file NdbOperationDefine.cpp.
|
friend |
Reciver(s)
Definition at line 48 of file NdbOperation.hpp.