📄 ndboperation.hpp
字号:
virtual int prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId); virtual void setLastFlag(NdbApiSignal* signal, Uint32 lastFlag); int prepareSendInterpreted(); // Help routine to prepare* int receiveTCKEYREF(NdbApiSignal*); int checkMagicNumber(bool b = true); // Verify correct object int checkState_TransId(NdbApiSignal* aSignal);/****************************************************************************** * These are support methods only used locally in this class.******************************************************************************/ virtual int equal_impl(const NdbColumnImpl*,const char* aValue, Uint32 len); virtual NdbRecAttr* getValue_impl(const NdbColumnImpl*, char* aValue = 0); int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len); NdbBlob* getBlobHandle(NdbTransaction* aCon, const NdbColumnImpl* anAttrObject); 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, bool, Uint32 Label); int branch_col_null(Uint32 type, Uint32 col, Uint32 Label); // Handle ATTRINFO signals int insertATTRINFO(Uint32 aData); int insertATTRINFOloop(const Uint32* aDataPtr, Uint32 aLength); int insertKEYINFO(const char* aValue, Uint32 aStartPosition, Uint32 aKeyLenInByte); virtual void setErrorCode(int aErrorCode); virtual void setErrorCodeAbort(int aErrorCode); void handleFailedAI_ElemLen(); // When not all attribute data // were received 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() { return theReceiver.getId(); }; // get table or index key from prepared signals int getKeyFromTCREQ(Uint32* data, unsigned size); virtual void setReadLockMode(LockMode lockMode);/****************************************************************************** * These are the private variables that are defined in the operation objects. *****************************************************************************/ Type m_type; NdbReceiver theReceiver; NdbError theError; // Errorcode int theErrorLine; // Error line Ndb* theNdb; // Point back to the Ndb object. NdbTransaction* theNdbCon; // Point back to the connection object. NdbOperation* theNext; // Next pointer to operation. union { NdbApiSignal* theTCREQ; // The TC[KEY/INDX]REQ signal object NdbApiSignal* theSCAN_TABREQ; }; NdbApiSignal* theFirstATTRINFO; // The first ATTRINFO signal object NdbApiSignal* theCurrentATTRINFO; // The current ATTRINFO signal object Uint32 theTotalCurrAI_Len; // The total number of attribute info // words currently defined Uint32 theAI_LenInCurrAI; // The number of words defined in the // current ATTRINFO signal NdbApiSignal* theLastKEYINFO; // The first KEYINFO signal object 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; // Pointer to where to write KEYINFO Uint32* theATTRINFOptr; // Pointer to where to write ATTRINFO const class NdbTableImpl* m_currentTable; // The current table const class NdbTableImpl* m_accessTable; // Index table (== current for pk) // Set to TRUE when a tuple key attribute has been defined. Uint32 theTupleKeyDefined[NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY][3]; Uint32 theTotalNrOfKeyWordInSignal; // The total number of // keyword in signal. Uint32 theTupKeyLen; // Length of the tuple key in words // left until done Uint8 theNoOfTupKeyLeft; // The number of tuple key attributes OperationType theOperationType; // Read Request, Update Req...... LockMode theLockMode; // Can be set to WRITE if read operation OperationStatus theStatus; // The status of the operation. Uint32 theMagicNumber; // Magic number to verify that object // is correct Uint32 theScanInfo; // Scan info bits (take over flag etc) Uint32 theDistributionKey; // Distribution Key size if used Uint32 theSubroutineSize; // Size of subroutines for interpretation Uint32 theInitialReadSize; // Size of initial reads for interpretation Uint32 theInterpretedSize; // Size of interpretation Uint32 theFinalUpdateSize; // Size of final updates for interpretation Uint32 theFinalReadSize; // Size of final reads for interpretation Uint8 theStartIndicator; // Indicator of whether start operation Uint8 theCommitIndicator; // Indicator of whether commit operation Uint8 theSimpleIndicator; // Indicator of whether simple operation Uint8 theDirtyIndicator; // Indicator of whether dirty operation Uint8 theInterpretIndicator; // Indicator of whether interpreted operation Int8 theDistrKeyIndicator_; // Indicates whether distr. key is used Uint16 m_tcReqGSN; Uint16 m_keyInfoGSN; Uint16 m_attrInfoGSN; // Blobs in this operation NdbBlob* theBlobList; /* * Abort option per operation, used by blobs. Default -1. If set, * overrides abort option on connection level. If set to IgnoreError, * does not cause execute() to return failure. This is different from * IgnoreError on connection level. */ Int8 m_abortOption; friend struct Ndb_free_list_t<NdbOperation>;};#ifdef NDB_NO_DROPPED_SIGNAL#include <stdlib.h>#endif#ifndef DOXYGEN_SHOULD_SKIP_INTERNALinlineintNdbOperation::checkMagicNumber(bool b){ if (theMagicNumber != 0xABCDEF01){#ifdef NDB_NO_DROPPED_SIGNAL if(b) abort();#endif return -1; } return 0;}inlinevoidNdbOperation::setStartIndicator(){ theStartIndicator = 1;}inlineintNdbOperation::getNdbErrorLine(){ return theErrorLine;}/******************************************************************************void next(NdbOperation* aNdbOperation);Parameters: aNdbOperation: Pointers to the NdbOperation object.Remark: Set the next variable of the operation object.******************************************************************************/inlinevoidNdbOperation::next(NdbOperation* aNdbOperation){ theNext = aNdbOperation;}/******************************************************************************NdbOperation* next();Return Value: Return next pointer to NdbOperation object.Remark: Get the next variable of the operation object.******************************************************************************/inlineNdbOperation*NdbOperation::next(){ return theNext;}inlineconst NdbOperation*NdbOperation::next() const { return theNext;}inlineconst NdbRecAttr*NdbOperation::getFirstRecAttr() const { return theReceiver.theFirstRecAttr;}/******************************************************************************Type getType() Return Value Return the Type.Remark: Gets type of access.******************************************************************************/inlineconst NdbOperation::TypeNdbOperation::getType() const{ return m_type;} /******************************************************************************OperationStatus Status();Return Value Return the OperationStatus. Parameters: aStatus: The status.Remark: Sets Operation status. ******************************************************************************/inlineNdbOperation::OperationStatus NdbOperation::Status(){ return theStatus;}/******************************************************************************void Status(OperationStatus aStatus);Parameters: aStatus: The status.Remark: Sets Operation status. ******************************************************************************/inlinevoid NdbOperation::Status( OperationStatus aStatus ){ theStatus = aStatus;}/******************************************************************************void NdbCon(NdbTransaction* aNdbCon);Parameters: aNdbCon: Pointers to NdbTransaction object.Remark: Set the reference to the connection in the operation object.******************************************************************************/inlinevoidNdbOperation::NdbCon(NdbTransaction* aNdbCon){ theNdbCon = aNdbCon;}inlineintNdbOperation::equal(const char* anAttrName, Int32 aPar){ return equal(anAttrName, (const char*)&aPar, (Uint32)4);}inlineintNdbOperation::equal(const char* anAttrName, Uint32 aPar){ return equal(anAttrName, (const char*)&aPar, (Uint32)4);}inlineintNdbOperation::equal(const char* anAttrName, Int64 aPar){ return equal(anAttrName, (const char*)&aPar, (Uint32)8);}inlineintNdbOperation::equal(const char* anAttrName, Uint64 aPar){ return equal(anAttrName, (const char*)&aPar, (Uint32)8);}inlineintNdbOperation::equal(Uint32 anAttrId, Int32 aPar){ return equal(anAttrId, (const char*)&aPar, (Uint32)4);}inlineintNdbOperation::equal(Uint32 anAttrId, Uint32 aPar){ return equal(anAttrId, (const char*)&aPar, (Uint32)4);}inlineintNdbOperation::equal(Uint32 anAttrId, Int64 aPar){ return equal(anAttrId, (const char*)&aPar, (Uint32)8);}inlineintNdbOperation::equal(Uint32 anAttrId, Uint64 aPar){ return equal(anAttrId, (const char*)&aPar, (Uint32)8);}inlineintNdbOperation::setValue(const char* anAttrName, Int32 aPar){ return setValue(anAttrName, (const char*)&aPar, (Uint32)4);}inlineintNdbOperation::setValue(const char* anAttrName, Uint32 aPar){ return setValue(anAttrName, (const char*)&aPar, (Uint32)4);}inlineintNdbOperation::setValue(const char* anAttrName, Int64 aPar){ return setValue(anAttrName, (const char*)&aPar, (Uint32)8);}inlineintNdbOperation::setValue(const char* anAttrName, Uint64 aPar){ return setValue(anAttrName, (const char*)&aPar, (Uint32)8);}inlineintNdbOperation::setValue(const char* anAttrName, float aPar){ return setValue(anAttrName, (const char*)&aPar, (Uint32)4);}inlineintNdbOperation::setValue(const char* anAttrName, double aPar){ return setValue(anAttrName, (const char*)&aPar, (Uint32)8);}inlineintNdbOperation::setValue(Uint32 anAttrId, Int32 aPar){ return setValue(anAttrId, (const char*)&aPar, (Uint32)4);}inlineintNdbOperation::setValue(Uint32 anAttrId, Uint32 aPar){ return setValue(anAttrId, (const char*)&aPar, (Uint32)4);}inlineintNdbOperation::setValue(Uint32 anAttrId, Int64 aPar){ return setValue(anAttrId, (const char*)&aPar, (Uint32)8);}inlineintNdbOperation::setValue(Uint32 anAttrId, Uint64 aPar){ return setValue(anAttrId, (const char*)&aPar, (Uint32)8);}inlineintNdbOperation::setValue(Uint32 anAttrId, float aPar){ return setValue(anAttrId, (char*)&aPar, (Uint32)4);}inlineintNdbOperation::setValue(Uint32 anAttrId, double aPar){ return setValue(anAttrId, (const char*)&aPar, (Uint32)8);}#endif // doxygen#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -