diff options
Diffstat (limited to 'ndb/src/ndbapi/NdbOperation.cpp')
-rw-r--r-- | ndb/src/ndbapi/NdbOperation.cpp | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/ndb/src/ndbapi/NdbOperation.cpp b/ndb/src/ndbapi/NdbOperation.cpp index 88d8a000d50..ca08c39e070 100644 --- a/ndb/src/ndbapi/NdbOperation.cpp +++ b/ndb/src/ndbapi/NdbOperation.cpp @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> -#include <NdbConnection.hpp> +#include <NdbTransaction.hpp> #include <NdbOperation.hpp> #include "NdbApiSignal.hpp" #include "NdbRecAttr.hpp" @@ -37,7 +37,8 @@ * aTable: Pointers to the Table object * Remark: Creat an object of NdbOperation. ****************************************************************************/ -NdbOperation::NdbOperation(Ndb* aNdb) : +NdbOperation::NdbOperation(Ndb* aNdb, NdbOperation::Type aType) : + m_type(aType), theReceiver(aNdb), theErrorLine(0), theNdb(aNdb), @@ -49,7 +50,6 @@ NdbOperation::NdbOperation(Ndb* aNdb) : theCurrentATTRINFO(NULL), theTotalCurrAI_Len(0), theAI_LenInCurrAI(0), - theFirstKEYINFO(NULL), theLastKEYINFO(NULL), theFirstLabel(NULL), @@ -68,13 +68,11 @@ NdbOperation::NdbOperation(Ndb* aNdb) : //theSchemaVersion(0), theTotalNrOfKeyWordInSignal(8), theTupKeyLen(0), - theNoOfTupKeyDefined(0), + theNoOfTupKeyLeft(0), theOperationType(NotDefined), theStatus(Init), theMagicNumber(0xFE11D0), theScanInfo(0), - theDistrKeySize(0), - theDistributionGroup(0), m_tcReqGSN(GSN_TCKEYREQ), m_keyInfoGSN(GSN_KEYINFO), m_attrInfoGSN(GSN_ATTRINFO), @@ -131,7 +129,7 @@ NdbOperation::setErrorCodeAbort(int anErrorCode) *****************************************************************************/ int -NdbOperation::init(const NdbTableImpl* tab, NdbConnection* myConnection){ +NdbOperation::init(const NdbTableImpl* tab, NdbTransaction* myConnection){ NdbApiSignal* tSignal; theStatus = Init; theError.code = 0; @@ -145,14 +143,11 @@ NdbOperation::init(const NdbTableImpl* tab, NdbConnection* myConnection){ theFirstATTRINFO = NULL; theCurrentATTRINFO = NULL; - theFirstKEYINFO = NULL; theLastKEYINFO = NULL; - theTupKeyLen = 0; - theNoOfTupKeyDefined = 0; - theDistrKeySize = 0; - theDistributionGroup = 0; + theTupKeyLen = 0; + theNoOfTupKeyLeft = tab->getNoOfPrimaryKeys(); theTotalCurrAI_Len = 0; theAI_LenInCurrAI = 0; @@ -161,9 +156,7 @@ NdbOperation::init(const NdbTableImpl* tab, NdbConnection* myConnection){ theSimpleIndicator = 0; theDirtyIndicator = 0; theInterpretIndicator = 0; - theDistrGroupIndicator= 0; - theDistrGroupType = 0; - theDistrKeyIndicator = 0; + theDistrKeyIndicator_ = 0; theScanInfo = 0; theTotalNrOfKeyWordInSignal = 8; theMagicNumber = 0xABCDEF01; @@ -210,11 +203,16 @@ NdbOperation::release() NdbBlob* tBlob; NdbBlob* tSaveBlob; - if (theTCREQ != NULL) + tSignal = theTCREQ; + while (tSignal != NULL) { - theNdb->releaseSignal(theTCREQ); - } + tSaveSignal = tSignal; + tSignal = tSignal->next(); + theNdb->releaseSignal(tSaveSignal); + } theTCREQ = NULL; + theLastKEYINFO = NULL; + tSignal = theFirstATTRINFO; while (tSignal != NULL) { @@ -224,15 +222,7 @@ NdbOperation::release() } theFirstATTRINFO = NULL; theCurrentATTRINFO = NULL; - tSignal = theFirstKEYINFO; - while (tSignal != NULL) - { - tSaveSignal = tSignal; - tSignal = tSignal->next(); - theNdb->releaseSignal(tSaveSignal); - } - theFirstKEYINFO = NULL; - theLastKEYINFO = NULL; + if (theInterpretIndicator == 1) { tBranch = theFirstBranch; @@ -403,3 +393,9 @@ NdbOperation::getTableName() const { return m_currentTable->m_externalName.c_str(); } + +const NdbDictionary::Table* +NdbOperation::getTable() const +{ + return m_currentTable; +} |