summaryrefslogtreecommitdiff
path: root/ndb/src/ndbapi
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2004-12-23 11:21:01 +0100
committerunknown <tomas@poseidon.ndb.mysql.com>2004-12-23 11:21:01 +0100
commit356d343ced28673b4dd76f3600aaf535099979a4 (patch)
tree98ab28712f22e6f7c9bb588452c63480e54754a5 /ndb/src/ndbapi
parentfde8d07de354dda6d9d9b45d3295a8fb17d53e17 (diff)
downloadmariadb-git-356d343ced28673b4dd76f3600aaf535099979a4.tar.gz
backwards compatible name change NdbConnectionto NdbTransaction
removed friend declarations from doxygen updated some documentation in mgmapi BitKeeper/deleted/.del-NdbCursorOperation.hpp~da121aeaf101b136: Delete: ndb/include/ndbapi/NdbCursorOperation.hpp BitKeeper/deleted/.del-NdbCursorOperation.cpp~8d49480ced2deba5: Delete: ndb/src/ndbapi/NdbCursorOperation.cpp ndb/include/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/ScanTab.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcCommit.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcHbRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcIndx.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyFailConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcRollbackRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TransIdAI.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/mgmapi/mgmapi.h: backwards compatible name change NdbConnectionto NdbTransaction documented some missing things in mgmapi ndb/include/ndbapi/Ndb.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbApi.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbBlob.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbDictionary.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbEventOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbRecAttr.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbReceiver.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanFilter.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbTransaction.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndb.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbApiSignal.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbBlob.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbImpl.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbIndexOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationDefine.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationExec.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationInt.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationSearch.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbReceiver.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbScanOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransaction.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransactionScan.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndberr.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbif.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbinit.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndblist.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/tools/restore/consumer_restore.hpp: backwards compatible name change NdbConnectionto NdbTransaction sql/ha_ndbcluster.h: backwards compatible name change NdbConnectionto NdbTransaction
Diffstat (limited to 'ndb/src/ndbapi')
-rw-r--r--ndb/src/ndbapi/Makefile.am4
-rw-r--r--ndb/src/ndbapi/Ndb.cpp88
-rw-r--r--ndb/src/ndbapi/NdbApiSignal.hpp2
-rw-r--r--ndb/src/ndbapi/NdbBlob.cpp6
-rw-r--r--ndb/src/ndbapi/NdbCursorOperation.cpp51
-rw-r--r--ndb/src/ndbapi/NdbImpl.hpp1
-rw-r--r--ndb/src/ndbapi/NdbIndexOperation.cpp4
-rw-r--r--ndb/src/ndbapi/NdbOperation.cpp4
-rw-r--r--ndb/src/ndbapi/NdbOperationDefine.cpp45
-rw-r--r--ndb/src/ndbapi/NdbOperationExec.cpp4
-rw-r--r--ndb/src/ndbapi/NdbOperationInt.cpp32
-rw-r--r--ndb/src/ndbapi/NdbOperationSearch.cpp2
-rw-r--r--ndb/src/ndbapi/NdbReceiver.cpp2
-rw-r--r--ndb/src/ndbapi/NdbScanOperation.cpp26
-rw-r--r--ndb/src/ndbapi/NdbTransaction.cpp (renamed from ndb/src/ndbapi/NdbConnection.cpp)298
-rw-r--r--ndb/src/ndbapi/NdbTransactionScan.cpp (renamed from ndb/src/ndbapi/NdbConnectionScan.cpp)18
-rw-r--r--ndb/src/ndbapi/Ndberr.cpp4
-rw-r--r--ndb/src/ndbapi/Ndbif.cpp139
-rw-r--r--ndb/src/ndbapi/Ndbinit.cpp10
-rw-r--r--ndb/src/ndbapi/Ndblist.cpp33
20 files changed, 343 insertions, 430 deletions
diff --git a/ndb/src/ndbapi/Makefile.am b/ndb/src/ndbapi/Makefile.am
index 9044812beec..b734e058b87 100644
--- a/ndb/src/ndbapi/Makefile.am
+++ b/ndb/src/ndbapi/Makefile.am
@@ -14,8 +14,8 @@ libndbapi_la_SOURCES = \
Ndberr.cpp \
ndberror.c \
NdbErrorOut.cpp \
- NdbConnection.cpp \
- NdbConnectionScan.cpp \
+ NdbTransaction.cpp \
+ NdbTransactionScan.cpp \
NdbOperation.cpp \
NdbOperationSearch.cpp \
NdbOperationScan.cpp \
diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp
index 06aa7365179..4f08ac5d829 100644
--- a/ndb/src/ndbapi/Ndb.cpp
+++ b/ndb/src/ndbapi/Ndb.cpp
@@ -27,7 +27,7 @@ Name: Ndb.cpp
#include "NdbApiSignal.hpp"
#include "NdbImpl.hpp"
#include <NdbOperation.hpp>
-#include <NdbConnection.hpp>
+#include <NdbTransaction.hpp>
#include <NdbEventOperation.hpp>
#include <NdbRecAttr.hpp>
#include <md5_hash.hpp>
@@ -43,7 +43,7 @@ void connect();
Connect to any node which has no connection at the moment.
****************************************************************************/
-NdbConnection* Ndb::doConnect(Uint32 tConNode)
+NdbTransaction* Ndb::doConnect(Uint32 tConNode)
{
Uint32 tNode;
Uint32 i = 0;;
@@ -56,7 +56,7 @@ NdbConnection* Ndb::doConnect(Uint32 tConNode)
//****************************************************************************
// We have connections now to the desired node. Return
//****************************************************************************
- return getConnectedNdbConnection(tConNode);
+ return getConnectedNdbTransaction(tConNode);
} else if (TretCode != 0) {
tAnyAlive = 1;
}//if
@@ -91,7 +91,7 @@ NdbConnection* Ndb::doConnect(Uint32 tConNode)
theCurrentConnectCounter = 2;
theCurrentConnectIndex = i;
}//if
- return getConnectedNdbConnection(tNode);
+ return getConnectedNdbTransaction(tNode);
} else if (TretCode != 0) {
tAnyAlive = 1;
}//if
@@ -127,12 +127,12 @@ Ndb::NDB_connect(Uint32 tNode)
return 0;
}
- NdbConnection * tConArray = theConnectionArray[tNode];
+ NdbTransaction * tConArray = theConnectionArray[tNode];
if (tConArray != NULL) {
return 2;
}
- NdbConnection * tNdbCon = getNdbCon(); // Get free connection object.
+ NdbTransaction * tNdbCon = getNdbCon(); // Get free connection object.
if (tNdbCon == NULL) {
return 4;
}//if
@@ -148,10 +148,10 @@ Ndb::NDB_connect(Uint32 tNode)
}//if
tSignal->setData(tNdbCon->ptr2int(), 1);
//************************************************
-// Set connection pointer as NdbConnection object
+// Set connection pointer as NdbTransaction object
//************************************************
tSignal->setData(theMyRef, 2); // Set my block reference
- tNdbCon->Status(NdbConnection::Connecting); // Set status to connecting
+ tNdbCon->Status(NdbTransaction::Connecting); // Set status to connecting
Uint32 nodeSequence;
{ // send and receive signal
Guard guard(tp->theMutexPtr);
@@ -170,11 +170,11 @@ Ndb::NDB_connect(Uint32 tNode)
tReturnCode = -1;
}//if
}
- if ((tReturnCode == 0) && (tNdbCon->Status() == NdbConnection::Connected)) {
+ if ((tReturnCode == 0) && (tNdbCon->Status() == NdbTransaction::Connected)) {
//************************************************
// Send and receive was successful
//************************************************
- NdbConnection* tPrevFirst = theConnectionArray[tNode];
+ NdbTransaction* tPrevFirst = theConnectionArray[tNode];
tNdbCon->setConnectedNodeId(tNode, nodeSequence);
tNdbCon->setMyBlockReference(theMyRef);
@@ -190,14 +190,14 @@ Ndb::NDB_connect(Uint32 tNode)
}//if
}//Ndb::NDB_connect()
-NdbConnection *
-Ndb::getConnectedNdbConnection(Uint32 nodeId){
- NdbConnection* next = theConnectionArray[nodeId];
+NdbTransaction *
+Ndb::getConnectedNdbTransaction(Uint32 nodeId){
+ NdbTransaction* next = theConnectionArray[nodeId];
theConnectionArray[nodeId] = next->theNext;
next->theNext = NULL;
return next;
-}//Ndb::getConnectedNdbConnection()
+}//Ndb::getConnectedNdbTransaction()
/*****************************************************************************
disconnect();
@@ -208,7 +208,7 @@ void
Ndb::doDisconnect()
{
DBUG_ENTER("Ndb::doDisconnect");
- NdbConnection* tNdbCon;
+ NdbTransaction* tNdbCon;
CHECK_STATUS_MACRO_VOID;
DBUG_PRINT("info", ("theNoOfDBnodes=%d", theNoOfDBnodes));
@@ -218,14 +218,14 @@ Ndb::doDisconnect()
Uint32 tNode = theDBnodes[i];
tNdbCon = theConnectionArray[tNode];
while (tNdbCon != NULL) {
- NdbConnection* tmpNdbCon = tNdbCon;
+ NdbTransaction* tmpNdbCon = tNdbCon;
tNdbCon = tNdbCon->theNext;
releaseConnectToNdb(tmpNdbCon);
}//while
}//for
tNdbCon = theTransactionList;
while (tNdbCon != NULL) {
- NdbConnection* tmpNdbCon = tNdbCon;
+ NdbTransaction* tmpNdbCon = tNdbCon;
tNdbCon = tNdbCon->theNext;
releaseConnectToNdb(tmpNdbCon);
}//while
@@ -301,13 +301,13 @@ Ndb::waitUntilReady(int timeout)
}
/*****************************************************************************
-NdbConnection* startTransaction();
+NdbTransaction* startTransaction();
Return Value: Returns a pointer to a connection object.
Return NULL otherwise.
Remark: Start transaction. Synchronous.
*****************************************************************************/
-NdbConnection*
+NdbTransaction*
Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen)
{
DBUG_ENTER("Ndb::startTransaction");
@@ -328,7 +328,7 @@ Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen)
nodeId = 0;
}//if
{
- NdbConnection *trans= startTransactionLocal(aPriority, nodeId);
+ NdbTransaction *trans= startTransactionLocal(aPriority, nodeId);
DBUG_PRINT("exit",("start trans: 0x%x transid: 0x%llx",
trans, trans ? trans->getTransactionId() : 0));
DBUG_RETURN(trans);
@@ -339,15 +339,15 @@ Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen)
}//Ndb::startTransaction()
/*****************************************************************************
-NdbConnection* hupp(NdbConnection* pBuddyTrans);
+NdbTransaction* hupp(NdbTransaction* pBuddyTrans);
Return Value: Returns a pointer to a connection object.
Connected to the same node as pBuddyTrans
and also using the same transction id
Remark: Start transaction. Synchronous.
*****************************************************************************/
-NdbConnection*
-Ndb::hupp(NdbConnection* pBuddyTrans)
+NdbTransaction*
+Ndb::hupp(NdbTransaction* pBuddyTrans)
{
DBUG_ENTER("Ndb::hupp");
@@ -363,7 +363,7 @@ Ndb::hupp(NdbConnection* pBuddyTrans)
checkFailedNode();
Uint32 nodeId = pBuddyTrans->getConnectedNodeId();
- NdbConnection* pCon = startTransactionLocal(aPriority, nodeId);
+ NdbTransaction* pCon = startTransactionLocal(aPriority, nodeId);
if(pCon == NULL)
DBUG_RETURN(NULL);
@@ -384,7 +384,7 @@ Ndb::hupp(NdbConnection* pBuddyTrans)
}//if
}//Ndb::hupp()
-NdbConnection*
+NdbTransaction*
Ndb::startTransactionDGroup(Uint32 aPriority, const char * keyData, int type)
{
@@ -414,7 +414,7 @@ Ndb::startTransactionDGroup(Uint32 aPriority, const char * keyData, int type)
fragmentId = getFragmentId(hashValue);
}//if
Uint32 nodeId = guessPrimaryNode(fragmentId);
- NdbConnection* trans= startTransactionLocal(aPriority, nodeId);
+ NdbTransaction* trans= startTransactionLocal(aPriority, nodeId);
DBUG_PRINT("exit", ("start DGroup trans: 0x%x transid: 0x%llx",
trans, trans ? trans->getTransactionId() : 0));
return trans;
@@ -423,7 +423,7 @@ Ndb::startTransactionDGroup(Uint32 aPriority, const char * keyData, int type)
}//if
}//Ndb::startTransaction()
-NdbConnection*
+NdbTransaction*
Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId)
{
#ifdef VM_TRACE
@@ -437,13 +437,13 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId)
DBUG_ENTER("Ndb::startTransactionLocal");
DBUG_PRINT("enter", ("nodeid: %d", nodeId));
- NdbConnection* tConnection;
+ NdbTransaction* tConnection;
Uint64 tFirstTransId = theFirstTransId;
tConnection = doConnect(nodeId);
if (tConnection == NULL) {
DBUG_RETURN(NULL);
}//if
- NdbConnection* tConNext = theTransactionList;
+ NdbTransaction* tConNext = theTransactionList;
tConnection->init();
theTransactionList = tConnection; // into a transaction list.
tConnection->next(tConNext); // Add the active connection object
@@ -459,7 +459,7 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId)
theFirstTransId = tFirstTransId + 1;
}//if
#ifdef VM_TRACE
- if (tConnection->theListState != NdbConnection::NotInList) {
+ if (tConnection->theListState != NdbTransaction::NotInList) {
printState("startTransactionLocal %x", tConnection);
abort();
}
@@ -468,17 +468,17 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId)
}//Ndb::startTransactionLocal()
/*****************************************************************************
-void closeTransaction(NdbConnection* aConnection);
+void closeTransaction(NdbTransaction* aConnection);
Parameters: aConnection: the connection used in the transaction.
Remark: Close transaction by releasing the connection and all operations.
*****************************************************************************/
void
-Ndb::closeTransaction(NdbConnection* aConnection)
+Ndb::closeTransaction(NdbTransaction* aConnection)
{
DBUG_ENTER("Ndb::closeTransaction");
- NdbConnection* tCon;
- NdbConnection* tPreviousCon;
+ NdbTransaction* tCon;
+ NdbTransaction* tPreviousCon;
if (aConnection == NULL) {
//-----------------------------------------------------
@@ -511,12 +511,12 @@ Ndb::closeTransaction(NdbConnection* aConnection)
if(aConnection->theError.code == 4008){
/**
- * When a SCAN timed-out, returning the NdbConnection leads
+ * When a SCAN timed-out, returning the NdbTransaction leads
* to reuse. And TC crashes when the API tries to reuse it to
* something else...
*/
#ifdef VM_TRACE
- printf("Scan timeout:ed NdbConnection-> "
+ printf("Scan timeout:ed NdbTransaction-> "
"not returning it-> memory leak\n");
#endif
DBUG_VOID_RETURN;
@@ -538,12 +538,12 @@ Ndb::closeTransaction(NdbConnection* aConnection)
if(aConnection->theError.code == 4008){
/**
- * Something timed-out, returning the NdbConnection leads
+ * Something timed-out, returning the NdbTransaction leads
* to reuse. And TC crashes when the API tries to reuse it to
* something else...
*/
#ifdef VM_TRACE
- printf("Con timeout:ed NdbConnection-> not returning it-> memory leak\n");
+ printf("Con timeout:ed NdbTransaction-> not returning it-> memory leak\n");
#endif
DBUG_VOID_RETURN;
}
@@ -582,7 +582,7 @@ Remark: Sends a signal to DIH.
int
Ndb::NdbTamper(TamperType aAction, int aNode)
{
- NdbConnection* tNdbConn;
+ NdbTransaction* tNdbConn;
NdbApiSignal tSignal(theMyRef);
int tNode;
int tAction;
@@ -624,7 +624,7 @@ Ndb::NdbTamper(TamperType aAction, int aNode)
tSignal.setData (tAction, 1);
tSignal.setData(tNdbConn->ptr2int(),2);
tSignal.setData(theMyRef,3); // Set return block reference
- tNdbConn->Status(NdbConnection::Connecting); // Set status to connecting
+ tNdbConn->Status(NdbTransaction::Connecting); // Set status to connecting
TransporterFacade *tp = TransporterFacade::instance();
if (tAction == 3) {
tp->lock_mutex();
@@ -657,7 +657,7 @@ Ndb::NdbTamper(TamperType aAction, int aNode)
}//if
ret_code = sendRecSignal(tNode, WAIT_NDB_TAMPER, &tSignal, 0);
if (ret_code == 0) {
- if (tNdbConn->Status() != NdbConnection::Connected) {
+ if (tNdbConn->Status() != NdbTransaction::Connected) {
theRestartGCI = 0;
}//if
releaseNdbCon(tNdbConn);
@@ -914,7 +914,7 @@ Ndb::opTupleIdOnNdb(Uint32 aTableId, Uint64 opValue, Uint32 op)
{
DEBUG_TRACE("opTupleIdOnNdb");
- NdbConnection* tConnection;
+ NdbTransaction* tConnection;
NdbOperation* tOperation;
Uint64 tValue;
NdbRecAttr* tRecAttrResult;
@@ -1368,7 +1368,7 @@ Ndb::pollEvents(int aMillisecondNumber)
extern NdbMutex *ndb_print_state_mutex;
static bool
-checkdups(NdbConnection** list, unsigned no)
+checkdups(NdbTransaction** list, unsigned no)
{
for (unsigned i = 0; i < no; i++)
for (unsigned j = i + 1; j < no; j++)
@@ -1393,7 +1393,7 @@ Ndb::printState(const char* fmt, ...)
#endif
ndbout << endl;
for (unsigned n = 0; n < MAX_NDB_NODES; n++) {
- NdbConnection* con = theConnectionArray[n];
+ NdbTransaction* con = theConnectionArray[n];
if (con != 0) {
ndbout << "conn " << n << ":" << endl;
while (con != 0) {
diff --git a/ndb/src/ndbapi/NdbApiSignal.hpp b/ndb/src/ndbapi/NdbApiSignal.hpp
index 52c3be2256c..353c575d420 100644
--- a/ndb/src/ndbapi/NdbApiSignal.hpp
+++ b/ndb/src/ndbapi/NdbApiSignal.hpp
@@ -93,7 +93,7 @@ private:
void setDataPtr(Uint32 *);
- friend class NdbConnection;
+ friend class NdbTransaction;
friend class NdbScanReceiver;
friend class Table;
void copyFrom(const NdbApiSignal * src);
diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp
index 0a1433c71f3..8424440f91e 100644
--- a/ndb/src/ndbapi/NdbBlob.cpp
+++ b/ndb/src/ndbapi/NdbBlob.cpp
@@ -16,7 +16,7 @@
#include <Ndb.hpp>
#include <NdbDictionaryImpl.hpp>
-#include <NdbConnection.hpp>
+#include <NdbTransaction.hpp>
#include <NdbOperation.hpp>
#include <NdbIndexOperation.hpp>
#include <NdbRecAttr.hpp>
@@ -1059,7 +1059,7 @@ NdbBlob::invokeActiveHook()
* data. For read operation adds read of head+inline.
*/
int
-NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* aColumn)
+NdbBlob::atPrepare(NdbTransaction* aCon, NdbOperation* anOp, const NdbColumnImpl* aColumn)
{
assert(theState == Idle);
// ndb api stuff
@@ -1550,7 +1550,7 @@ NdbBlob::setErrorCode(NdbOperation* anOp, bool invalidFlag)
}
void
-NdbBlob::setErrorCode(NdbConnection* aCon, bool invalidFlag)
+NdbBlob::setErrorCode(NdbTransaction* aCon, bool invalidFlag)
{
int code = 0;
if (theNdbCon != NULL && (code = theNdbCon->theError.code) != 0)
diff --git a/ndb/src/ndbapi/NdbCursorOperation.cpp b/ndb/src/ndbapi/NdbCursorOperation.cpp
deleted file mode 100644
index a9f84c4c110..00000000000
--- a/ndb/src/ndbapi/NdbCursorOperation.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (C) 2003 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/*****************************************************************************
- * Name: NdbCursorOperation.cpp
- * Include:
- * Link:
- * Author: UABMASD Martin Sköld INN/V Alzato
- * Date: 2002-04-01
- * Version: 0.1
- * Description: Cursor support
- * Documentation:
- * Adjust: 2002-04-01 UABMASD First version.
- ****************************************************************************/
-
-#include <NdbCursorOperation.hpp>
-#include <NdbResultSet.hpp>
-
-NdbCursorOperation::NdbCursorOperation(Ndb* aNdb) :
-{
-}
-
-NdbCursorOperation::~NdbCursorOperation()
-{
- if (m_resultSet)
- delete m_resultSet;
-}
-
-void NdbCursorOperation::cursInit()
-{
- // Initialize result set
-}
-
-NdbResultSet* NdbCursorOperation::getResultSet()
-{
-}
-
-
diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp
index baac0ee2846..b8f0cdd64a9 100644
--- a/ndb/src/ndbapi/NdbImpl.hpp
+++ b/ndb/src/ndbapi/NdbImpl.hpp
@@ -35,6 +35,7 @@ public:
#include <NdbError.hpp>
#include <NdbCondition.h>
#include <NdbReceiver.hpp>
+#include <NdbTransaction.hpp>
#include <NdbOperation.hpp>
#include <NdbTick.h>
diff --git a/ndb/src/ndbapi/NdbIndexOperation.cpp b/ndb/src/ndbapi/NdbIndexOperation.cpp
index 18a55e99aec..181449549bb 100644
--- a/ndb/src/ndbapi/NdbIndexOperation.cpp
+++ b/ndb/src/ndbapi/NdbIndexOperation.cpp
@@ -17,7 +17,7 @@
#include <ndb_global.h>
#include <NdbIndexOperation.hpp>
#include <Ndb.hpp>
-#include <NdbConnection.hpp>
+#include <NdbTransaction.hpp>
#include "NdbApiSignal.hpp"
#include <AttributeHeader.hpp>
#include <signaldata/TcIndx.hpp>
@@ -53,7 +53,7 @@ NdbIndexOperation::~NdbIndexOperation()
int
NdbIndexOperation::indxInit(const NdbIndexImpl * anIndex,
const NdbTableImpl * aTable,
- NdbConnection* myConnection)
+ NdbTransaction* myConnection)
{
NdbOperation::init(aTable, myConnection);
diff --git a/ndb/src/ndbapi/NdbOperation.cpp b/ndb/src/ndbapi/NdbOperation.cpp
index f0de2242d2a..58147f2654e 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"
@@ -128,7 +128,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;
diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp
index aabb58fc974..ce4a28c1273 100644
--- a/ndb/src/ndbapi/NdbOperationDefine.cpp
+++ b/ndb/src/ndbapi/NdbOperationDefine.cpp
@@ -14,28 +14,17 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/*****************************************************************************
- * Name: NdbOperationDefine.C
- * Include:
- * Link:
- * Author: UABMNST Mona Natterkvist UAB/B/SD
- * Date: 970829
- * Version: 0.1
- * Description: Interface between TIS and NDB
- * Documentation:
- * Adjust: 971022 UABMNST First version.
- *****************************************************************************/
-#include "NdbOperation.hpp"
+#include <ndb_global.h>
+#include <NdbOperation.hpp>
#include "NdbApiSignal.hpp"
-#include "NdbConnection.hpp"
-#include "Ndb.hpp"
-#include "NdbRecAttr.hpp"
+#include <NdbTransaction.hpp>
+#include <Ndb.hpp>
+#include <NdbRecAttr.hpp>
#include "NdbUtil.hpp"
#include "NdbOut.hpp"
#include "NdbImpl.hpp"
#include <NdbIndexScanOperation.hpp>
-#include "NdbBlob.hpp"
+#include <NdbBlob.hpp>
#include <Interpreter.hpp>
@@ -48,7 +37,7 @@
int
NdbOperation::insertTuple()
{
- NdbConnection* tNdbCon = theNdbCon;
+ NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine;
if (theStatus == Init) {
theStatus = OperationDefined;
@@ -68,7 +57,7 @@ NdbOperation::insertTuple()
int
NdbOperation::updateTuple()
{
- NdbConnection* tNdbCon = theNdbCon;
+ NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine;
if (theStatus == Init) {
theStatus = OperationDefined;
@@ -88,7 +77,7 @@ NdbOperation::updateTuple()
int
NdbOperation::writeTuple()
{
- NdbConnection* tNdbCon = theNdbCon;
+ NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine;
if (theStatus == Init) {
theStatus = OperationDefined;
@@ -128,7 +117,7 @@ NdbOperation::readTuple(NdbOperation::LockMode lm)
int
NdbOperation::readTuple()
{
- NdbConnection* tNdbCon = theNdbCon;
+ NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine;
if (theStatus == Init) {
theStatus = OperationDefined;
@@ -149,7 +138,7 @@ NdbOperation::readTuple()
int
NdbOperation::deleteTuple()
{
- NdbConnection* tNdbCon = theNdbCon;
+ NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine;
if (theStatus == Init) {
theStatus = OperationDefined;
@@ -170,7 +159,7 @@ NdbOperation::deleteTuple()
int
NdbOperation::readTupleExclusive()
{
- NdbConnection* tNdbCon = theNdbCon;
+ NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine;
if (theStatus == Init) {
theStatus = OperationDefined;
@@ -247,7 +236,7 @@ NdbOperation::committedRead()
int
NdbOperation::dirtyUpdate()
{
- NdbConnection* tNdbCon = theNdbCon;
+ NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine;
if (theStatus == Init) {
theStatus = OperationDefined;
@@ -270,7 +259,7 @@ NdbOperation::dirtyUpdate()
int
NdbOperation::dirtyWrite()
{
- NdbConnection* tNdbCon = theNdbCon;
+ NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine;
if (theStatus == Init) {
theStatus = OperationDefined;
@@ -293,7 +282,7 @@ NdbOperation::dirtyWrite()
int
NdbOperation::interpretedUpdateTuple()
{
- NdbConnection* tNdbCon = theNdbCon;
+ NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine;
if (theStatus == Init) {
theStatus = OperationDefined;
@@ -316,7 +305,7 @@ NdbOperation::interpretedUpdateTuple()
int
NdbOperation::interpretedDeleteTuple()
{
- NdbConnection* tNdbCon = theNdbCon;
+ NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine;
if (theStatus == Init) {
theStatus = OperationDefined;
@@ -578,7 +567,7 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo,
}//NdbOperation::setValue()
NdbBlob*
-NdbOperation::getBlobHandle(NdbConnection* aCon, const NdbColumnImpl* tAttrInfo)
+NdbOperation::getBlobHandle(NdbTransaction* aCon, const NdbColumnImpl* tAttrInfo)
{
NdbBlob* tBlob = theBlobList;
NdbBlob* tLastBlob = NULL;
diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp
index 738977a0920..4200300615d 100644
--- a/ndb/src/ndbapi/NdbOperationExec.cpp
+++ b/ndb/src/ndbapi/NdbOperationExec.cpp
@@ -16,7 +16,7 @@
#include <ndb_global.h>
#include <NdbOperation.hpp>
-#include <NdbConnection.hpp>
+#include <NdbTransaction.hpp>
#include "NdbApiSignal.hpp"
#include <Ndb.hpp>
#include <NdbRecAttr.hpp>
@@ -544,7 +544,7 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal)
// blobs want this
if (m_abortOption != AO_IgnoreError)
{
- theNdbCon->theReturnStatus = NdbConnection::ReturnFailure;
+ theNdbCon->theReturnStatus = NdbTransaction::ReturnFailure;
}
theError.code = aSignal->readData(4);
theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4), ao);
diff --git a/ndb/src/ndbapi/NdbOperationInt.cpp b/ndb/src/ndbapi/NdbOperationInt.cpp
index ee7b8132cd1..1a8523ef5fd 100644
--- a/ndb/src/ndbapi/NdbOperationInt.cpp
+++ b/ndb/src/ndbapi/NdbOperationInt.cpp
@@ -14,23 +14,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/************************************************************************************************
-Name: NdbOperationInt.C
-Include:
-Link:
-Author: UABRONM Mikael Ronström UAB/M/MT
-Date: 991029
-Version: 0.1
-Description: Interpreted operations in NDB API
-Documentation:
-Adjust: 991029 UABRONM First version.
-************************************************************************************************/
-#include "NdbOperation.hpp"
+#include <NdbOperation.hpp>
#include "NdbApiSignal.hpp"
-#include "NdbConnection.hpp"
-#include "Ndb.hpp"
-#include "NdbRecAttr.hpp"
+#include <NdbTransaction.hpp>
+#include <Ndb.hpp>
+#include <NdbRecAttr.hpp>
#include "NdbUtil.hpp"
#include "Interpreter.hpp"
#include <NdbIndexScanOperation.hpp>
@@ -94,7 +82,7 @@ NdbOperation::incCheck(const NdbColumnImpl* tNdbColumnImpl)
}
return tNdbColumnImpl->m_attrId;
} else {
- if (theNdbCon->theCommitStatus == NdbConnection::Started)
+ if (theNdbCon->theCommitStatus == NdbTransaction::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -146,7 +134,7 @@ NdbOperation::write_attrCheck(const NdbColumnImpl* tNdbColumnImpl)
}
return tNdbColumnImpl->m_attrId;
} else {
- if (theNdbCon->theCommitStatus == NdbConnection::Started)
+ if (theNdbCon->theCommitStatus == NdbTransaction::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -194,7 +182,7 @@ NdbOperation::read_attrCheck(const NdbColumnImpl* tNdbColumnImpl)
}
return tNdbColumnImpl->m_attrId;
} else {
- if (theNdbCon->theCommitStatus == NdbConnection::Started)
+ if (theNdbCon->theCommitStatus == NdbTransaction::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -230,7 +218,7 @@ NdbOperation::initial_interpreterCheck()
}
return 0;
} else {
- if (theNdbCon->theCommitStatus == NdbConnection::Started)
+ if (theNdbCon->theCommitStatus == NdbTransaction::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -256,7 +244,7 @@ NdbOperation::labelCheck()
}
return 0;
} else {
- if (theNdbCon->theCommitStatus == NdbConnection::Started)
+ if (theNdbCon->theCommitStatus == NdbTransaction::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -276,7 +264,7 @@ NdbOperation::intermediate_interpreterCheck()
}
return 0;
} else {
- if (theNdbCon->theCommitStatus == NdbConnection::Started)
+ if (theNdbCon->theCommitStatus == NdbTransaction::Started)
setErrorCodeAbort(4200);
}
return -1;
diff --git a/ndb/src/ndbapi/NdbOperationSearch.cpp b/ndb/src/ndbapi/NdbOperationSearch.cpp
index ea9e7ab75f8..65e2ab3e769 100644
--- a/ndb/src/ndbapi/NdbOperationSearch.cpp
+++ b/ndb/src/ndbapi/NdbOperationSearch.cpp
@@ -31,7 +31,7 @@ Adjust: 971022 UABMNST First version.
#include <NdbOperation.hpp>
#include "NdbApiSignal.hpp"
-#include <NdbConnection.hpp>
+#include <NdbTransaction.hpp>
#include <Ndb.hpp>
#include "NdbImpl.hpp"
#include <NdbOut.hpp>
diff --git a/ndb/src/ndbapi/NdbReceiver.cpp b/ndb/src/ndbapi/NdbReceiver.cpp
index 52bbf26f5df..8a3866af4bb 100644
--- a/ndb/src/ndbapi/NdbReceiver.cpp
+++ b/ndb/src/ndbapi/NdbReceiver.cpp
@@ -20,7 +20,7 @@
#include "NdbDictionaryImpl.hpp"
#include <NdbRecAttr.hpp>
#include <AttributeHeader.hpp>
-#include <NdbConnection.hpp>
+#include <NdbTransaction.hpp>
#include <TransporterFacade.hpp>
#include <signaldata/TcKeyConf.hpp>
diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp
index ccc2278e049..006c9428321 100644
--- a/ndb/src/ndbapi/NdbScanOperation.cpp
+++ b/ndb/src/ndbapi/NdbScanOperation.cpp
@@ -18,7 +18,7 @@
#include <Ndb.hpp>
#include <NdbScanOperation.hpp>
#include <NdbIndexScanOperation.hpp>
-#include <NdbConnection.hpp>
+#include <NdbTransaction.hpp>
#include "NdbApiSignal.hpp"
#include <NdbOut.hpp>
#include "NdbDictionaryImpl.hpp"
@@ -63,7 +63,7 @@ NdbScanOperation::~NdbScanOperation()
void
NdbScanOperation::setErrorCode(int aErrorCode){
- NdbConnection* tmp = theNdbCon;
+ NdbTransaction* tmp = theNdbCon;
theNdbCon = m_transConnection;
NdbOperation::setErrorCode(aErrorCode);
theNdbCon = tmp;
@@ -71,7 +71,7 @@ NdbScanOperation::setErrorCode(int aErrorCode){
void
NdbScanOperation::setErrorCodeAbort(int aErrorCode){
- NdbConnection* tmp = theNdbCon;
+ NdbTransaction* tmp = theNdbCon;
theNdbCon = m_transConnection;
NdbOperation::setErrorCodeAbort(aErrorCode);
theNdbCon = tmp;
@@ -86,11 +86,11 @@ NdbScanOperation::setErrorCodeAbort(int aErrorCode){
* Remark: Initiates operation record after allocation.
*****************************************************************************/
int
-NdbScanOperation::init(const NdbTableImpl* tab, NdbConnection* myConnection)
+NdbScanOperation::init(const NdbTableImpl* tab, NdbTransaction* myConnection)
{
m_transConnection = myConnection;
- //NdbConnection* aScanConnection = theNdb->startTransaction(myConnection);
- NdbConnection* aScanConnection = theNdb->hupp(myConnection);
+ //NdbTransaction* aScanConnection = theNdb->startTransaction(myConnection);
+ NdbTransaction* aScanConnection = theNdb->hupp(myConnection);
if (!aScanConnection){
setErrorCodeAbort(theNdb->getNdbError().code);
return -1;
@@ -349,7 +349,7 @@ NdbScanOperation::getFirstATTRINFOScan()
int
NdbScanOperation::executeCursor(int nodeId){
- NdbConnection * tCon = theNdbCon;
+ NdbTransaction * tCon = theNdbCon;
TransporterFacade* tp = TransporterFacade::instance();
Guard guard(tp->theMutexPtr);
@@ -383,7 +383,7 @@ NdbScanOperation::executeCursor(int nodeId){
TRACE_DEBUG("The node is stopping when attempting to start a scan");
setErrorCode(4030);
}//if
- tCon->theCommitStatus = NdbConnection::Aborted;
+ tCon->theCommitStatus = NdbTransaction::Aborted;
}//if
return -1;
}
@@ -856,9 +856,9 @@ NdbScanOperation::doSendScan(int aProcessorId)
}//NdbOperation::doSendScan()
/*****************************************************************************
- * NdbOperation* takeOverScanOp(NdbConnection* updateTrans);
+ * NdbOperation* takeOverScanOp(NdbTransaction* updateTrans);
*
- * Parameters: The update transactions NdbConnection pointer.
+ * Parameters: The update transactions NdbTransaction pointer.
* Return Value: A reference to the transferred operation object
* or NULL if no success.
* Remark: Take over the scanning transactions NdbOperation
@@ -868,8 +868,8 @@ NdbScanOperation::doSendScan(int aProcessorId)
*
* FUTURE IMPLEMENTATION: (This note was moved from header file.)
* In the future, it will even be possible to transfer
- * to a NdbConnection on another Ndb-object.
- * In this case the receiving NdbConnection-object must call
+ * to a NdbTransaction on another Ndb-object.
+ * In this case the receiving NdbTransaction-object must call
* a method receiveOpFromScan to actually receive the information.
* This means that the updating transactions can be placed
* in separate threads and thus increasing the parallelism during
@@ -896,7 +896,7 @@ NdbScanOperation::getKeyFromKEYINFO20(Uint32* data, unsigned size)
}
NdbOperation*
-NdbScanOperation::takeOverScanOp(OperationType opType, NdbConnection* pTrans){
+NdbScanOperation::takeOverScanOp(OperationType opType, NdbTransaction* pTrans){
Uint32 idx = m_current_api_receiver;
Uint32 last = m_api_receivers_count;
diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbTransaction.cpp
index db5a95a3cd6..0ecfd3924bd 100644
--- a/ndb/src/ndbapi/NdbConnection.cpp
+++ b/ndb/src/ndbapi/NdbTransaction.cpp
@@ -16,7 +16,7 @@
#include <ndb_global.h>
#include <NdbOut.hpp>
-#include <NdbConnection.hpp>
+#include <NdbTransaction.hpp>
#include <NdbOperation.hpp>
#include <NdbScanOperation.hpp>
#include <NdbIndexScanOperation.hpp>
@@ -34,13 +34,13 @@
#include <signaldata/TcHbRep.hpp>
/*****************************************************************************
-NdbConnection( Ndb* aNdb );
+NdbTransaction( Ndb* aNdb );
Return Value: None
Parameters: aNdb: Pointers to the Ndb object
Remark: Creates a connection object.
*****************************************************************************/
-NdbConnection::NdbConnection( Ndb* aNdb ) :
+NdbTransaction::NdbTransaction( Ndb* aNdb ) :
theSendStatus(NotInit),
theCallbackFunction(NULL),
theCallbackObject(NULL),
@@ -89,19 +89,19 @@ NdbConnection::NdbConnection( Ndb* aNdb ) :
CHECK_SZ(m_db_nodes, NdbNodeBitmask::Size);
CHECK_SZ(m_failed_db_nodes, NdbNodeBitmask::Size);
-}//NdbConnection::NdbConnection()
+}//NdbTransaction::NdbTransaction()
/*****************************************************************************
-~NdbConnection();
+~NdbTransaction();
Remark: Deletes the connection object.
*****************************************************************************/
-NdbConnection::~NdbConnection()
+NdbTransaction::~NdbTransaction()
{
- DBUG_ENTER("NdbConnection::~NdbConnection");
+ DBUG_ENTER("NdbTransaction::~NdbTransaction");
theNdb->theNdbObjectIdMap->unmap(theId, this);
DBUG_VOID_RETURN;
-}//NdbConnection::~NdbConnection()
+}//NdbTransaction::~NdbTransaction()
/*****************************************************************************
void init();
@@ -109,7 +109,7 @@ void init();
Remark: Initialise connection object for new transaction.
*****************************************************************************/
void
-NdbConnection::init()
+NdbTransaction::init()
{
theListState = NotInList;
theInUseState = true;
@@ -149,7 +149,7 @@ NdbConnection::init()
//
theBlobFlag = false;
thePendingBlobOps = 0;
-}//NdbConnection::init()
+}//NdbTransaction::init()
/*****************************************************************************
setOperationErrorCode(int error);
@@ -158,9 +158,9 @@ Remark: Sets an error code on the connection object from an
operation object.
*****************************************************************************/
void
-NdbConnection::setOperationErrorCode(int error)
+NdbTransaction::setOperationErrorCode(int error)
{
- DBUG_ENTER("NdbConnection::setOperationErrorCode");
+ DBUG_ENTER("NdbTransaction::setOperationErrorCode");
setErrorCode(error);
DBUG_VOID_RETURN;
}
@@ -172,9 +172,9 @@ Remark: Sets an error code on the connection object from an
operation object.
*****************************************************************************/
void
-NdbConnection::setOperationErrorCodeAbort(int error, int abortOption)
+NdbTransaction::setOperationErrorCodeAbort(int error, int abortOption)
{
- DBUG_ENTER("NdbConnection::setOperationErrorCodeAbort");
+ DBUG_ENTER("NdbTransaction::setOperationErrorCodeAbort");
if (abortOption == -1)
abortOption = m_abortOption;
if (theTransactionIsStarted == false) {
@@ -194,20 +194,20 @@ setErrorCode(int anErrorCode);
Remark: Sets an error indication on the connection object.
*****************************************************************************/
void
-NdbConnection::setErrorCode(int error)
+NdbTransaction::setErrorCode(int error)
{
- DBUG_ENTER("NdbConnection::setErrorCode");
+ DBUG_ENTER("NdbTransaction::setErrorCode");
DBUG_PRINT("enter", ("error: %d, theError.code: %d", error, theError.code));
if (theError.code == 0)
theError.code = error;
DBUG_VOID_RETURN;
-}//NdbConnection::setErrorCode()
+}//NdbTransaction::setErrorCode()
int
-NdbConnection::restart(){
- DBUG_ENTER("NdbConnection::restart");
+NdbTransaction::restart(){
+ DBUG_ENTER("NdbTransaction::restart");
if(theCompletionStatus == CompletedSuccess){
releaseCompletedOperations();
Uint64 tTransid = theNdb->theFirstTransId;
@@ -232,7 +232,7 @@ void handleExecuteCompletion(void);
Remark: Handle time-out on a transaction object.
*****************************************************************************/
void
-NdbConnection::handleExecuteCompletion()
+NdbTransaction::handleExecuteCompletion()
{
/***************************************************************************
* Move the NdbOperation objects from the list of executing
@@ -250,7 +250,7 @@ NdbConnection::handleExecuteCompletion()
}//if
theSendStatus = InitState;
return;
-}//NdbConnection::handleExecuteCompletion()
+}//NdbTransaction::handleExecuteCompletion()
/*****************************************************************************
int execute(ExecType aTypeOfExec, CommitType aTypeOfCommit, int forceSend);
@@ -261,11 +261,11 @@ Parameters : aTypeOfExec: Type of execute.
Remark: Initialise connection object for new transaction.
*****************************************************************************/
int
-NdbConnection::execute(ExecType aTypeOfExec,
+NdbTransaction::execute(ExecType aTypeOfExec,
AbortOption abortOption,
int forceSend)
{
- DBUG_ENTER("NdbConnection::execute");
+ DBUG_ENTER("NdbTransaction::execute");
DBUG_PRINT("enter", ("aTypeOfExec: %d, abortOption: %d",
aTypeOfExec, abortOption));
@@ -396,11 +396,11 @@ NdbConnection::execute(ExecType aTypeOfExec,
}
int
-NdbConnection::executeNoBlobs(ExecType aTypeOfExec,
+NdbTransaction::executeNoBlobs(ExecType aTypeOfExec,
AbortOption abortOption,
int forceSend)
{
- DBUG_ENTER("NdbConnection::executeNoBlobs");
+ DBUG_ENTER("NdbTransaction::executeNoBlobs");
DBUG_PRINT("enter", ("aTypeOfExec: %d, abortOption: %d",
aTypeOfExec, abortOption));
@@ -409,7 +409,7 @@ NdbConnection::executeNoBlobs(ExecType aTypeOfExec,
// since last execute or since beginning. If this works ok we will continue
// by calling the poll with wait method. This method will return when
// the NDB kernel has completed its task or when 10 seconds have passed.
-// The NdbConnectionCallBack-method will receive the return code of the
+// The NdbTransactionCallBack-method will receive the return code of the
// transaction. The normal methods of reading error codes still apply.
//------------------------------------------------------------------------
Ndb* tNdb = theNdb;
@@ -457,7 +457,7 @@ NdbConnection::executeNoBlobs(ExecType aTypeOfExec,
}
thePendingBlobOps = 0;
DBUG_RETURN(0);
-}//NdbConnection::execute()
+}//NdbTransaction::execute()
/*****************************************************************************
void executeAsynchPrepare(ExecType aTypeOfExec,
@@ -475,12 +475,12 @@ Parameters : aTypeOfExec: Type of execute.
Remark: Prepare a part of a transaction in an asynchronous manner.
*****************************************************************************/
void
-NdbConnection::executeAsynchPrepare( ExecType aTypeOfExec,
+NdbTransaction::executeAsynchPrepare( ExecType aTypeOfExec,
NdbAsynchCallback aCallback,
void* anyObject,
AbortOption abortOption)
{
- DBUG_ENTER("NdbConnection::executeAsynchPrepare");
+ DBUG_ENTER("NdbTransaction::executeAsynchPrepare");
DBUG_PRINT("enter", ("aTypeOfExec: %d, aCallback: %x, anyObject: %x",
aTypeOfExec, aCallback, anyObject));
@@ -643,14 +643,14 @@ NdbConnection::executeAsynchPrepare( ExecType aTypeOfExec,
NdbNodeBitmask::clear(m_db_nodes);
NdbNodeBitmask::clear(m_failed_db_nodes);
DBUG_VOID_RETURN;
-}//NdbConnection::executeAsynchPrepare()
+}//NdbTransaction::executeAsynchPrepare()
-void NdbConnection::close()
+void NdbTransaction::close()
{
theNdb->closeTransaction(this);
}
-int NdbConnection::refresh(){
+int NdbTransaction::refresh(){
return sendTC_HBREP();
}
@@ -662,7 +662,7 @@ Parameters : None.
Remark: Order NDB to refresh the timeout counter of the transaction.
******************************************************************************/
int
-NdbConnection::sendTC_HBREP() // Send a TC_HBREP signal;
+NdbTransaction::sendTC_HBREP() // Send a TC_HBREP signal;
{
NdbApiSignal* tSignal;
Ndb* tNdb = theNdb;
@@ -697,7 +697,7 @@ NdbConnection::sendTC_HBREP() // Send a TC_HBREP signal;
}
return 0;
-}//NdbConnection::sendTC_HBREP()
+}//NdbTransaction::sendTC_HBREP()
/*****************************************************************************
int doSend();
@@ -709,9 +709,9 @@ Remark: Send all operations belonging to this connection.
object from the prepared transactions array on the Ndb-object.
*****************************************************************************/
int
-NdbConnection::doSend()
+NdbTransaction::doSend()
{
- DBUG_ENTER("NdbConnection::doSend");
+ DBUG_ENTER("NdbTransaction::doSend");
/*
This method assumes that at least one operation have been defined. This
@@ -770,7 +770,7 @@ NdbConnection::doSend()
theTransactionIsStarted = false;
theCommitStatus = Aborted;
DBUG_RETURN(-1);
-}//NdbConnection::doSend()
+}//NdbTransaction::doSend()
/**************************************************************************
int sendROLLBACK();
@@ -780,7 +780,7 @@ Parameters : None.
Remark: Order NDB to rollback the transaction.
**************************************************************************/
int
-NdbConnection::sendROLLBACK() // Send a TCROLLBACKREQ signal;
+NdbTransaction::sendROLLBACK() // Send a TCROLLBACKREQ signal;
{
Ndb* tNdb = theNdb;
if ((theTransactionIsStarted == true) &&
@@ -824,7 +824,7 @@ NdbConnection::sendROLLBACK() // Send a TCROLLBACKREQ signal;
return 0;
;
}//if
-}//NdbConnection::sendROLLBACK()
+}//NdbTransaction::sendROLLBACK()
/***************************************************************************
int sendCOMMIT();
@@ -835,7 +835,7 @@ Parameters : None.
Remark: Order NDB to commit the transaction.
***************************************************************************/
int
-NdbConnection::sendCOMMIT() // Send a TC_COMMITREQ signal;
+NdbTransaction::sendCOMMIT() // Send a TC_COMMITREQ signal;
{
NdbApiSignal tSignal(theNdb->theMyRef);
Uint32 tTransId1, tTransId2;
@@ -857,7 +857,7 @@ NdbConnection::sendCOMMIT() // Send a TC_COMMITREQ signal;
} else {
return -1;
}//if
-}//NdbConnection::sendCOMMIT()
+}//NdbTransaction::sendCOMMIT()
/******************************************************************************
void release();
@@ -865,7 +865,7 @@ void release();
Remark: Release all operations.
******************************************************************************/
void
-NdbConnection::release(){
+NdbTransaction::release(){
releaseOperations();
if ( (theTransactionIsStarted == true) &&
((theCommitStatus != Committed) &&
@@ -884,10 +884,10 @@ NdbConnection::release(){
abort();
}
#endif
-}//NdbConnection::release()
+}//NdbTransaction::release()
void
-NdbConnection::releaseOps(NdbOperation* tOp){
+NdbTransaction::releaseOps(NdbOperation* tOp){
while (tOp != NULL) {
NdbOperation* tmp = tOp;
tOp->release();
@@ -902,7 +902,7 @@ void releaseOperations();
Remark: Release all operations.
******************************************************************************/
void
-NdbConnection::releaseOperations()
+NdbTransaction::releaseOperations()
{
// Release any open scans
releaseScanOperations(m_theFirstScanOperation);
@@ -922,15 +922,15 @@ NdbConnection::releaseOperations()
m_theFirstScanOperation = NULL;
m_theLastScanOperation = NULL;
m_firstExecutedScanOp = NULL;
-}//NdbConnection::releaseOperations()
+}//NdbTransaction::releaseOperations()
void
-NdbConnection::releaseCompletedOperations()
+NdbTransaction::releaseCompletedOperations()
{
releaseOps(theCompletedFirstOp);
theCompletedFirstOp = NULL;
theCompletedLastOp = NULL;
-}//NdbConnection::releaseOperations()
+}//NdbTransaction::releaseOperations()
/******************************************************************************
void releaseScanOperations();
@@ -939,7 +939,7 @@ Remark: Release all cursor operations.
(NdbScanOperation and NdbIndexOperation)
******************************************************************************/
void
-NdbConnection::releaseScanOperations(NdbIndexScanOperation* cursorOp)
+NdbTransaction::releaseScanOperations(NdbIndexScanOperation* cursorOp)
{
while(cursorOp != 0){
NdbIndexScanOperation* next = (NdbIndexScanOperation*)cursorOp->next();
@@ -947,7 +947,7 @@ NdbConnection::releaseScanOperations(NdbIndexScanOperation* cursorOp)
theNdb->releaseScanOperation(cursorOp);
cursorOp = next;
}
-}//NdbConnection::releaseScanOperations()
+}//NdbTransaction::releaseScanOperations()
/*****************************************************************************
NdbOperation* getNdbOperation(const char* aTableName);
@@ -957,13 +957,13 @@ Return Value Return a pointer to a NdbOperation object if getNdbOperation
Return NULL : In all other case.
Parameters: aTableName : Name of the database table.
Remark: Get an operation from NdbOperation idlelist and get the
- NdbConnection object
+ NdbTransaction object
who was fetch by startTransaction pointing to this operation
getOperation will set the theTableId in the NdbOperation object.
synchronous
******************************************************************************/
NdbOperation*
-NdbConnection::getNdbOperation(const char* aTableName)
+NdbTransaction::getNdbOperation(const char* aTableName)
{
if (theCommitStatus == Started){
NdbTableImpl* table = theNdb->theDictionary->getTable(aTableName);
@@ -978,7 +978,7 @@ NdbConnection::getNdbOperation(const char* aTableName)
setOperationErrorCodeAbort(4114);
return NULL;
-}//NdbConnection::getNdbOperation()
+}//NdbTransaction::getNdbOperation()
/*****************************************************************************
NdbOperation* getNdbOperation(int aTableId);
@@ -988,13 +988,13 @@ Return Value Return a pointer to a NdbOperation object if getNdbOperation
Return NULL: In all other case.
Parameters: tableId : Id of the database table beeing deleted.
Remark: Get an operation from NdbOperation object idlelist and
- get the NdbConnection object who was fetch by
+ get the NdbTransaction object who was fetch by
startTransaction pointing to this operation
getOperation will set the theTableId in the NdbOperation
object, synchronous.
*****************************************************************************/
NdbOperation*
-NdbConnection::getNdbOperation(const NdbTableImpl * tab, NdbOperation* aNextOp)
+NdbTransaction::getNdbOperation(const NdbTableImpl * tab, NdbOperation* aNextOp)
{
NdbOperation* tOp;
@@ -1038,15 +1038,15 @@ NdbConnection::getNdbOperation(const NdbTableImpl * tab, NdbOperation* aNextOp)
getNdbOp_error1:
setOperationErrorCodeAbort(4000);
return NULL;
-}//NdbConnection::getNdbOperation()
+}//NdbTransaction::getNdbOperation()
-NdbOperation* NdbConnection::getNdbOperation(const NdbDictionary::Table * table)
+NdbOperation* NdbTransaction::getNdbOperation(const NdbDictionary::Table * table)
{
if (table)
return getNdbOperation(& NdbTableImpl::getImpl(*table));
else
return NULL;
-}//NdbConnection::getNdbOperation()
+}//NdbTransaction::getNdbOperation()
// NdbScanOperation
/*****************************************************************************
@@ -1055,12 +1055,12 @@ NdbScanOperation* getNdbScanOperation(const char* aTableName);
Return Value Return a pointer to a NdbScanOperation object if getNdbScanOperation was succesful.
Return NULL : In all other case.
Parameters: aTableName : Name of the database table.
-Remark: Get an operation from NdbScanOperation idlelist and get the NdbConnection object
+Remark: Get an operation from NdbScanOperation idlelist and get the NdbTransaction object
who was fetch by startTransaction pointing to this operation
getOperation will set the theTableId in the NdbOperation object.synchronous
******************************************************************************/
NdbScanOperation*
-NdbConnection::getNdbScanOperation(const char* aTableName)
+NdbTransaction::getNdbScanOperation(const char* aTableName)
{
if (theCommitStatus == Started){
NdbTableImpl* tab = theNdb->theDictionary->getTable(aTableName);
@@ -1074,7 +1074,7 @@ NdbConnection::getNdbScanOperation(const char* aTableName)
setOperationErrorCodeAbort(4114);
return NULL;
-}//NdbConnection::getNdbScanOperation()
+}//NdbTransaction::getNdbScanOperation()
/*****************************************************************************
NdbScanOperation* getNdbScanOperation(const char* anIndexName, const char* aTableName);
@@ -1083,12 +1083,12 @@ Return Value Return a pointer to a NdbScanOperation object if getNdbScanOpera
Return NULL : In all other case.
Parameters: anIndexName : Name of the index to use.
aTableName : Name of the database table.
-Remark: Get an operation from NdbScanOperation idlelist and get the NdbConnection object
+Remark: Get an operation from NdbScanOperation idlelist and get the NdbTransaction object
who was fetch by startTransaction pointing to this operation
getOperation will set the theTableId in the NdbOperation object.synchronous
******************************************************************************/
NdbIndexScanOperation*
-NdbConnection::getNdbIndexScanOperation(const char* anIndexName,
+NdbTransaction::getNdbIndexScanOperation(const char* anIndexName,
const char* aTableName)
{
NdbIndexImpl* index =
@@ -1099,7 +1099,7 @@ NdbConnection::getNdbIndexScanOperation(const char* anIndexName,
}
NdbIndexScanOperation*
-NdbConnection::getNdbIndexScanOperation(const NdbIndexImpl* index,
+NdbTransaction::getNdbIndexScanOperation(const NdbIndexImpl* index,
const NdbTableImpl* table)
{
if (theCommitStatus == Started){
@@ -1119,10 +1119,10 @@ NdbConnection::getNdbIndexScanOperation(const NdbIndexImpl* index,
setOperationErrorCodeAbort(4114);
return NULL;
-}//NdbConnection::getNdbIndexScanOperation()
+}//NdbTransaction::getNdbIndexScanOperation()
NdbIndexScanOperation*
-NdbConnection::getNdbIndexScanOperation(const NdbDictionary::Index * index,
+NdbTransaction::getNdbIndexScanOperation(const NdbDictionary::Index * index,
const NdbDictionary::Table * table)
{
if (index && table)
@@ -1130,7 +1130,7 @@ NdbConnection::getNdbIndexScanOperation(const NdbDictionary::Index * index,
& NdbTableImpl::getImpl(*table));
else
return NULL;
-}//NdbConnection::getNdbIndexScanOperation()
+}//NdbTransaction::getNdbIndexScanOperation()
/*****************************************************************************
NdbScanOperation* getNdbScanOperation(int aTableId);
@@ -1138,12 +1138,12 @@ NdbScanOperation* getNdbScanOperation(int aTableId);
Return Value Return a pointer to a NdbOperation object if getNdbOperation was succesful.
Return NULL: In all other case.
Parameters: tableId : Id of the database table beeing deleted.
-Remark: Get an operation from NdbScanOperation object idlelist and get the NdbConnection
+Remark: Get an operation from NdbScanOperation object idlelist and get the NdbTransaction
object who was fetch by startTransaction pointing to this operation
getOperation will set the theTableId in the NdbOperation object, synchronous.
*****************************************************************************/
NdbIndexScanOperation*
-NdbConnection::getNdbScanOperation(const NdbTableImpl * tab)
+NdbTransaction::getNdbScanOperation(const NdbTableImpl * tab)
{
NdbIndexScanOperation* tOp;
@@ -1162,10 +1162,10 @@ NdbConnection::getNdbScanOperation(const NdbTableImpl * tab)
getNdbOp_error1:
setOperationErrorCodeAbort(4000);
return NULL;
-}//NdbConnection::getNdbScanOperation()
+}//NdbTransaction::getNdbScanOperation()
void
-NdbConnection::remove_list(NdbOperation*& list, NdbOperation* op){
+NdbTransaction::remove_list(NdbOperation*& list, NdbOperation* op){
NdbOperation* tmp= list;
if(tmp == op)
list = op->next();
@@ -1178,7 +1178,7 @@ NdbConnection::remove_list(NdbOperation*& list, NdbOperation* op){
}
void
-NdbConnection::define_scan_op(NdbIndexScanOperation * tOp){
+NdbTransaction::define_scan_op(NdbIndexScanOperation * tOp){
// Link scan operation into list of cursor operations
if (m_theLastScanOperation == NULL)
m_theFirstScanOperation = m_theLastScanOperation = tOp;
@@ -1190,13 +1190,13 @@ NdbConnection::define_scan_op(NdbIndexScanOperation * tOp){
}
NdbScanOperation*
-NdbConnection::getNdbScanOperation(const NdbDictionary::Table * table)
+NdbTransaction::getNdbScanOperation(const NdbDictionary::Table * table)
{
if (table)
return getNdbScanOperation(& NdbTableImpl::getImpl(*table));
else
return NULL;
-}//NdbConnection::getNdbScanOperation()
+}//NdbTransaction::getNdbScanOperation()
// IndexOperation
@@ -1207,12 +1207,12 @@ NdbIndexOperation* getNdbIndexOperation(const char* anIndexName,
Return Value Return a pointer to a NdbOperation object if getNdbScanOperation was succesful.
Return NULL : In all other case.
Parameters: aTableName : Name of the database table.
-Remark: Get an operation from NdbScanOperation idlelist and get the NdbConnection object
+Remark: Get an operation from NdbScanOperation idlelist and get the NdbTransaction object
who was fetch by startTransaction pointing to this operation
getOperation will set the theTableId in the NdbScanOperation object.synchronous
******************************************************************************/
NdbIndexOperation*
-NdbConnection::getNdbIndexOperation(const char* anIndexName,
+NdbTransaction::getNdbIndexOperation(const char* anIndexName,
const char* aTableName)
{
if (theCommitStatus == Started) {
@@ -1235,7 +1235,7 @@ NdbConnection::getNdbIndexOperation(const char* anIndexName,
setOperationErrorCodeAbort(4114);
return 0;
-}//NdbConnection::getNdbIndexOperation()
+}//NdbTransaction::getNdbIndexOperation()
/*****************************************************************************
NdbIndexOperation* getNdbIndexOperation(int anIndexId, int aTableId);
@@ -1243,12 +1243,12 @@ NdbIndexOperation* getNdbIndexOperation(int anIndexId, int aTableId);
Return Value Return a pointer to a NdbIndexOperation object if getNdbIndexOperation was succesful.
Return NULL: In all other case.
Parameters: tableId : Id of the database table beeing deleted.
-Remark: Get an operation from NdbIndexOperation object idlelist and get the NdbConnection
+Remark: Get an operation from NdbIndexOperation object idlelist and get the NdbTransaction
object who was fetch by startTransaction pointing to this operation
getOperation will set the theTableId in the NdbIndexOperation object, synchronous.
*****************************************************************************/
NdbIndexOperation*
-NdbConnection::getNdbIndexOperation(const NdbIndexImpl * anIndex,
+NdbTransaction::getNdbIndexOperation(const NdbIndexImpl * anIndex,
const NdbTableImpl * aTable,
NdbOperation* aNextOp)
{
@@ -1289,10 +1289,10 @@ NdbConnection::getNdbIndexOperation(const NdbIndexImpl * anIndex,
getNdbOp_error1:
setOperationErrorCodeAbort(4000);
return NULL;
-}//NdbConnection::getNdbIndexOperation()
+}//NdbTransaction::getNdbIndexOperation()
NdbIndexOperation*
-NdbConnection::getNdbIndexOperation(const NdbDictionary::Index * index,
+NdbTransaction::getNdbIndexOperation(const NdbDictionary::Index * index,
const NdbDictionary::Table * table)
{
if (index && table)
@@ -1300,7 +1300,7 @@ NdbConnection::getNdbIndexOperation(const NdbDictionary::Index * index,
& NdbTableImpl::getImpl(*table));
else
return NULL;
-}//NdbConnection::getNdbIndexOperation()
+}//NdbTransaction::getNdbIndexOperation()
/*******************************************************************************
@@ -1312,7 +1312,7 @@ Parameters: aSignal: The signal object pointer.
Remark: Sets theRestartGCI in the NDB object.
*******************************************************************************/
int
-NdbConnection::receiveDIHNDBTAMPER(NdbApiSignal* aSignal)
+NdbTransaction::receiveDIHNDBTAMPER(NdbApiSignal* aSignal)
{
if (theStatus != Connecting) {
return -1;
@@ -1321,7 +1321,7 @@ NdbConnection::receiveDIHNDBTAMPER(NdbApiSignal* aSignal)
theStatus = Connected;
}//if
return 0;
-}//NdbConnection::receiveDIHNDBTAMPER()
+}//NdbTransaction::receiveDIHNDBTAMPER()
/*******************************************************************************
int receiveTCSEIZECONF(NdbApiSignal* aSignal);
@@ -1332,7 +1332,7 @@ Parameters: aSignal: The signal object pointer.
Remark: Sets TC Connect pointer at reception of TCSEIZECONF.
*******************************************************************************/
int
-NdbConnection::receiveTCSEIZECONF(NdbApiSignal* aSignal)
+NdbTransaction::receiveTCSEIZECONF(NdbApiSignal* aSignal)
{
if (theStatus != Connecting)
{
@@ -1343,7 +1343,7 @@ NdbConnection::receiveTCSEIZECONF(NdbApiSignal* aSignal)
theStatus = Connected;
}
return 0;
-}//NdbConnection::receiveTCSEIZECONF()
+}//NdbTransaction::receiveTCSEIZECONF()
/*******************************************************************************
int receiveTCSEIZEREF(NdbApiSignal* aSignal);
@@ -1354,7 +1354,7 @@ Parameters: aSignal: The signal object pointer.
Remark: Sets TC Connect pointer.
*******************************************************************************/
int
-NdbConnection::receiveTCSEIZEREF(NdbApiSignal* aSignal)
+NdbTransaction::receiveTCSEIZEREF(NdbApiSignal* aSignal)
{
if (theStatus != Connecting)
{
@@ -1365,7 +1365,7 @@ NdbConnection::receiveTCSEIZEREF(NdbApiSignal* aSignal)
theNdb->theError.code = aSignal->readData(2);
return 0;
}
-}//NdbConnection::receiveTCSEIZEREF()
+}//NdbTransaction::receiveTCSEIZEREF()
/*******************************************************************************
int receiveTCRELEASECONF(NdbApiSignal* aSignal);
@@ -1376,7 +1376,7 @@ Parameters: aSignal: The signal object pointer.
Remark: DisConnect TC Connect pointer to NDBAPI.
*******************************************************************************/
int
-NdbConnection::receiveTCRELEASECONF(NdbApiSignal* aSignal)
+NdbTransaction::receiveTCRELEASECONF(NdbApiSignal* aSignal)
{
if (theStatus != DisConnecting)
{
@@ -1386,7 +1386,7 @@ NdbConnection::receiveTCRELEASECONF(NdbApiSignal* aSignal)
theStatus = NotConnected;
}
return 0;
-}//NdbConnection::receiveTCRELEASECONF()
+}//NdbTransaction::receiveTCRELEASECONF()
/*******************************************************************************
int receiveTCRELEASEREF(NdbApiSignal* aSignal);
@@ -1397,7 +1397,7 @@ Parameters: aSignal: The signal object pointer.
Remark: DisConnect TC Connect pointer to NDBAPI Failure.
*******************************************************************************/
int
-NdbConnection::receiveTCRELEASEREF(NdbApiSignal* aSignal)
+NdbTransaction::receiveTCRELEASEREF(NdbApiSignal* aSignal)
{
if (theStatus != DisConnecting) {
return -1;
@@ -1406,7 +1406,7 @@ NdbConnection::receiveTCRELEASEREF(NdbApiSignal* aSignal)
theNdb->theError.code = aSignal->readData(2);
return 0;
}//if
-}//NdbConnection::receiveTCRELEASEREF()
+}//NdbTransaction::receiveTCRELEASEREF()
/******************************************************************************
int receiveTC_COMMITCONF(NdbApiSignal* aSignal);
@@ -1417,7 +1417,7 @@ Parameters: aSignal: The signal object pointer.
Remark:
******************************************************************************/
int
-NdbConnection::receiveTC_COMMITCONF(const TcCommitConf * commitConf)
+NdbTransaction::receiveTC_COMMITCONF(const TcCommitConf * commitConf)
{
if(checkState_TransId(&commitConf->transId1)){
theCommitStatus = Committed;
@@ -1429,7 +1429,7 @@ NdbConnection::receiveTC_COMMITCONF(const TcCommitConf * commitConf)
#endif
}
return -1;
-}//NdbConnection::receiveTC_COMMITCONF()
+}//NdbTransaction::receiveTC_COMMITCONF()
/******************************************************************************
int receiveTC_COMMITREF(NdbApiSignal* aSignal);
@@ -1440,7 +1440,7 @@ Parameters: aSignal: The signal object pointer.
Remark:
******************************************************************************/
int
-NdbConnection::receiveTC_COMMITREF(NdbApiSignal* aSignal)
+NdbTransaction::receiveTC_COMMITREF(NdbApiSignal* aSignal)
{
const TcCommitRef * ref = CAST_CONSTPTR(TcCommitRef, aSignal->getDataPtr());
if(checkState_TransId(&ref->transId1)){
@@ -1456,7 +1456,7 @@ NdbConnection::receiveTC_COMMITREF(NdbApiSignal* aSignal)
}
return -1;
-}//NdbConnection::receiveTC_COMMITREF()
+}//NdbTransaction::receiveTC_COMMITREF()
/******************************************************************************
int receiveTCROLLBACKCONF(NdbApiSignal* aSignal);
@@ -1467,7 +1467,7 @@ Parameters: aSignal: The signal object pointer.
Remark:
******************************************************************************/
int
-NdbConnection::receiveTCROLLBACKCONF(NdbApiSignal* aSignal)
+NdbTransaction::receiveTCROLLBACKCONF(NdbApiSignal* aSignal)
{
if(checkState_TransId(aSignal->getDataPtr() + 1)){
theCommitStatus = Aborted;
@@ -1480,7 +1480,7 @@ NdbConnection::receiveTCROLLBACKCONF(NdbApiSignal* aSignal)
}
return -1;
-}//NdbConnection::receiveTCROLLBACKCONF()
+}//NdbTransaction::receiveTCROLLBACKCONF()
/*******************************************************************************
int receiveTCROLLBACKREF(NdbApiSignal* aSignal);
@@ -1491,7 +1491,7 @@ Parameters: aSignal: The signal object pointer.
Remark:
*******************************************************************************/
int
-NdbConnection::receiveTCROLLBACKREF(NdbApiSignal* aSignal)
+NdbTransaction::receiveTCROLLBACKREF(NdbApiSignal* aSignal)
{
if(checkState_TransId(aSignal->getDataPtr() + 1)){
setOperationErrorCodeAbort(aSignal->readData(4));
@@ -1506,7 +1506,7 @@ NdbConnection::receiveTCROLLBACKREF(NdbApiSignal* aSignal)
}
return -1;
-}//NdbConnection::receiveTCROLLBACKREF()
+}//NdbTransaction::receiveTCROLLBACKREF()
/*****************************************************************************
int receiveTCROLLBACKREP( NdbApiSignal* aSignal)
@@ -1518,7 +1518,7 @@ Parameters: aSignal: the signal object that contains the
Remark: Handles the reception of the ROLLBACKREP signal.
*****************************************************************************/
int
-NdbConnection::receiveTCROLLBACKREP( NdbApiSignal* aSignal)
+NdbTransaction::receiveTCROLLBACKREP( NdbApiSignal* aSignal)
{
/****************************************************************************
Check that we are expecting signals from this transaction and that it doesn't
@@ -1546,7 +1546,7 @@ transactions.
}
return -1;
-}//NdbConnection::receiveTCROLLBACKREP()
+}//NdbTransaction::receiveTCROLLBACKREP()
/*******************************************************************************
int receiveTCKEYCONF(NdbApiSignal* aSignal, Uint32 long_short_ind);
@@ -1557,7 +1557,7 @@ Parameters: aSignal: The signal object pointer.
Remark:
*******************************************************************************/
int
-NdbConnection::receiveTCKEYCONF(const TcKeyConf * keyConf, Uint32 aDataLength)
+NdbTransaction::receiveTCKEYCONF(const TcKeyConf * keyConf, Uint32 aDataLength)
{
NdbReceiver* tOp;
const Uint32 tTemp = keyConf->confInfo;
@@ -1586,7 +1586,7 @@ from other transactions.
done = 1;
tOp->setErrorCode(4119);
theCompletionStatus = CompletedFailure;
- theReturnStatus = NdbConnection::ReturnFailure;
+ theReturnStatus = NdbTransaction::ReturnFailure;
}
}
tNoComp += done;
@@ -1616,7 +1616,7 @@ from other transactions.
/**********************************************************************/
theError.code = 4011;
theCompletionStatus = CompletedFailure;
- theReturnStatus = NdbConnection::ReturnFailure;
+ theReturnStatus = NdbTransaction::ReturnFailure;
theCommitStatus = Aborted;
return 0;
}//if
@@ -1631,7 +1631,7 @@ from other transactions.
}
return -1;
-}//NdbConnection::receiveTCKEYCONF()
+}//NdbTransaction::receiveTCKEYCONF()
/*****************************************************************************
int receiveTCKEY_FAILCONF( NdbApiSignal* aSignal)
@@ -1643,7 +1643,7 @@ Parameters: aSignal: the signal object that contains the
Remark: Handles the reception of the TCKEY_FAILCONF signal.
*****************************************************************************/
int
-NdbConnection::receiveTCKEY_FAILCONF(const TcKeyFailConf * failConf)
+NdbTransaction::receiveTCKEY_FAILCONF(const TcKeyFailConf * failConf)
{
NdbOperation* tOp;
/*
@@ -1676,7 +1676,7 @@ NdbConnection::receiveTCKEY_FAILCONF(const TcKeyFailConf * failConf)
case NdbOperation::OpenScanRequest:
case NdbOperation::OpenRangeScanRequest:
theCompletionStatus = CompletedFailure;
- theReturnStatus = NdbConnection::ReturnFailure;
+ theReturnStatus = NdbTransaction::ReturnFailure;
setOperationErrorCodeAbort(4115);
tOp = NULL;
break;
@@ -1694,7 +1694,7 @@ NdbConnection::receiveTCKEY_FAILCONF(const TcKeyFailConf * failConf)
#endif
}
return -1;
-}//NdbConnection::receiveTCKEY_FAILCONF()
+}//NdbTransaction::receiveTCKEY_FAILCONF()
/*************************************************************************
int receiveTCKEY_FAILREF( NdbApiSignal* aSignal)
@@ -1706,7 +1706,7 @@ Parameters: aSignal: the signal object that contains the
Remark: Handles the reception of the TCKEY_FAILREF signal.
**************************************************************************/
int
-NdbConnection::receiveTCKEY_FAILREF(NdbApiSignal* aSignal)
+NdbTransaction::receiveTCKEY_FAILREF(NdbApiSignal* aSignal)
{
/*
Check that we are expecting signals from this transaction and
@@ -1718,19 +1718,19 @@ NdbConnection::receiveTCKEY_FAILREF(NdbApiSignal* aSignal)
We received an indication of that this transaction was aborted due to a
node failure.
*/
- if (theSendStatus == NdbConnection::sendTC_ROLLBACK) {
+ if (theSendStatus == NdbTransaction::sendTC_ROLLBACK) {
/*
We were in the process of sending a rollback anyways. We will
report it as a success.
*/
- theCompletionStatus = NdbConnection::CompletedSuccess;
+ theCompletionStatus = NdbTransaction::CompletedSuccess;
} else {
- theReturnStatus = NdbConnection::ReturnFailure;
- theCompletionStatus = NdbConnection::CompletedFailure;
+ theReturnStatus = NdbTransaction::ReturnFailure;
+ theCompletionStatus = NdbTransaction::CompletedFailure;
theError.code = 4031;
}//if
theReleaseOnClose = true;
- theCommitStatus = NdbConnection::Aborted;
+ theCommitStatus = NdbTransaction::Aborted;
return 0;
} else {
#ifdef VM_TRACE
@@ -1738,7 +1738,7 @@ NdbConnection::receiveTCKEY_FAILREF(NdbApiSignal* aSignal)
#endif
}
return -1;
-}//NdbConnection::receiveTCKEY_FAILREF()
+}//NdbTransaction::receiveTCKEY_FAILREF()
/******************************************************************************
int receiveTCINDXCONF(NdbApiSignal* aSignal, Uint32 long_short_ind);
@@ -1749,7 +1749,7 @@ Parameters: aSignal: The signal object pointer.
Remark:
******************************************************************************/
int
-NdbConnection::receiveTCINDXCONF(const TcIndxConf * indxConf,
+NdbTransaction::receiveTCINDXCONF(const TcIndxConf * indxConf,
Uint32 aDataLength)
{
if(checkState_TransId(&indxConf->transId1)){
@@ -1783,9 +1783,9 @@ NdbConnection::receiveTCINDXCONF(const TcIndxConf * indxConf,
// no Commit flag set. This is clearly an anomaly.
/**********************************************************************/
theError.code = 4011;
- theCompletionStatus = NdbConnection::CompletedFailure;
- theCommitStatus = NdbConnection::Aborted;
- theReturnStatus = NdbConnection::ReturnFailure;
+ theCompletionStatus = NdbTransaction::CompletedFailure;
+ theCommitStatus = NdbTransaction::Aborted;
+ theReturnStatus = NdbTransaction::ReturnFailure;
return 0;
}//if
if (tNoComp >= tNoSent) {
@@ -1799,7 +1799,7 @@ NdbConnection::receiveTCINDXCONF(const TcIndxConf * indxConf,
}
return -1;
-}//NdbConnection::receiveTCINDXCONF()
+}//NdbTransaction::receiveTCINDXCONF()
/*****************************************************************************
int receiveTCINDXREF( NdbApiSignal* aSignal)
@@ -1811,7 +1811,7 @@ Parameters: aSignal: the signal object that contains the
Remark: Handles the reception of the TCINDXREF signal.
*****************************************************************************/
int
-NdbConnection::receiveTCINDXREF( NdbApiSignal* aSignal)
+NdbTransaction::receiveTCINDXREF( NdbApiSignal* aSignal)
{
if(checkState_TransId(aSignal->getDataPtr()+1)){
theError.code = aSignal->readData(4); // Override any previous errors
@@ -1823,9 +1823,9 @@ NdbConnection::receiveTCINDXREF( NdbApiSignal* aSignal)
/* and we only need to report completion and return with the */
/* error code to the application. */
/**********************************************************************/
- theCompletionStatus = NdbConnection::CompletedFailure;
- theCommitStatus = NdbConnection::Aborted;
- theReturnStatus = NdbConnection::ReturnFailure;
+ theCompletionStatus = NdbTransaction::CompletedFailure;
+ theCommitStatus = NdbTransaction::Aborted;
+ theReturnStatus = NdbTransaction::ReturnFailure;
return 0;
} else {
#ifdef NDB_NO_DROPPED_SIGNAL
@@ -1834,7 +1834,7 @@ NdbConnection::receiveTCINDXREF( NdbApiSignal* aSignal)
}
return -1;
-}//NdbConnection::receiveTCINDXREF()
+}//NdbTransaction::receiveTCINDXREF()
/*******************************************************************************
int OpCompletedFailure();
@@ -1845,12 +1845,12 @@ Parameters: aErrorCode: The error code.
Remark: An operation was completed with failure.
*******************************************************************************/
int
-NdbConnection::OpCompleteFailure(Uint8 abortOption, bool setFailure)
+NdbTransaction::OpCompleteFailure(Uint8 abortOption, bool setFailure)
{
Uint32 tNoComp = theNoOfOpCompleted;
Uint32 tNoSent = theNoOfOpSent;
if (setFailure)
- theCompletionStatus = NdbConnection::CompletedFailure;
+ theCompletionStatus = NdbTransaction::CompletedFailure;
tNoComp++;
theNoOfOpCompleted = tNoComp;
if (tNoComp == tNoSent) {
@@ -1875,7 +1875,7 @@ NdbConnection::OpCompleteFailure(Uint8 abortOption, bool setFailure)
} else {
return -1; // Continue waiting for more signals
}//if
-}//NdbConnection::OpCompleteFailure()
+}//NdbTransaction::OpCompleteFailure()
/******************************************************************************
int OpCompleteSuccess();
@@ -1885,7 +1885,7 @@ Return Value: Return 0 : OpCompleteSuccess was successful.
Remark: An operation was completed with success.
*******************************************************************************/
int
-NdbConnection::OpCompleteSuccess()
+NdbTransaction::OpCompleteSuccess()
{
Uint32 tNoComp = theNoOfOpCompleted;
Uint32 tNoSent = theNoOfOpSent;
@@ -1898,11 +1898,11 @@ NdbConnection::OpCompleteSuccess()
} else {
setOperationErrorCodeAbort(4113); // Too many operations,
// stop waiting for more
- theCompletionStatus = NdbConnection::CompletedFailure;
- theReturnStatus = NdbConnection::ReturnFailure;
+ theCompletionStatus = NdbTransaction::CompletedFailure;
+ theReturnStatus = NdbTransaction::ReturnFailure;
return 0;
}//if
-}//NdbConnection::OpCompleteSuccess()
+}//NdbTransaction::OpCompleteSuccess()
/******************************************************************************
int getGCI();
@@ -1910,13 +1910,13 @@ NdbConnection::OpCompleteSuccess()
Remark: Get global checkpoint identity of the transaction
*******************************************************************************/
int
-NdbConnection::getGCI()
+NdbTransaction::getGCI()
{
- if (theCommitStatus == NdbConnection::Committed) {
+ if (theCommitStatus == NdbTransaction::Committed) {
return theGlobalCheckpointId;
}//if
return 0;
-}//NdbConnection::getGCI()
+}//NdbTransaction::getGCI()
/*******************************************************************************
Uint64 getTransactionId(void);
@@ -1924,31 +1924,31 @@ Uint64 getTransactionId(void);
Remark: Get the transaction identity.
*******************************************************************************/
Uint64
-NdbConnection::getTransactionId()
+NdbTransaction::getTransactionId()
{
return theTransactionId;
-}//NdbConnection::getTransactionId()
+}//NdbTransaction::getTransactionId()
-NdbConnection::CommitStatusType
-NdbConnection::commitStatus()
+NdbTransaction::CommitStatusType
+NdbTransaction::commitStatus()
{
return theCommitStatus;
-}//NdbConnection::commitStatus()
+}//NdbTransaction::commitStatus()
int
-NdbConnection::getNdbErrorLine()
+NdbTransaction::getNdbErrorLine()
{
return theErrorLine;
}
NdbOperation*
-NdbConnection::getNdbErrorOperation()
+NdbTransaction::getNdbErrorOperation()
{
return theErrorOperation;
-}//NdbConnection::getNdbErrorOperation()
+}//NdbTransaction::getNdbErrorOperation()
const NdbOperation *
-NdbConnection::getNextCompletedOperation(const NdbOperation * current) const {
+NdbTransaction::getNextCompletedOperation(const NdbOperation * current) const {
if(current == 0)
return theCompletedFirstOp;
return current->theNext;
@@ -1957,7 +1957,7 @@ NdbConnection::getNextCompletedOperation(const NdbOperation * current) const {
#ifdef VM_TRACE
#define CASE(x) case x: ndbout << " " << #x; break
void
-NdbConnection::printState()
+NdbTransaction::printState()
{
ndbout << "con=" << hex << this << dec;
ndbout << " node=" << getConnectedNodeId();
@@ -2010,7 +2010,7 @@ NdbConnection::printState()
#endif
int
-NdbConnection::report_node_failure(Uint32 id){
+NdbTransaction::report_node_failure(Uint32 id){
NdbNodeBitmask::set(m_failed_db_nodes, id);
if(!NdbNodeBitmask::get(m_db_nodes, id))
{
@@ -2044,11 +2044,11 @@ NdbConnection::report_node_failure(Uint32 id){
theNoOfOpCompleted = tNoComp;
if(count)
{
- theReturnStatus = NdbConnection::ReturnFailure;
+ theReturnStatus = NdbTransaction::ReturnFailure;
if(tNoComp == tNoSent)
{
theError.code = 4119;
- theCompletionStatus = NdbConnection::CompletedFailure;
+ theCompletionStatus = NdbTransaction::CompletedFailure;
return 1;
}
}
diff --git a/ndb/src/ndbapi/NdbConnectionScan.cpp b/ndb/src/ndbapi/NdbTransactionScan.cpp
index b0c546c512a..4c507f6ab8c 100644
--- a/ndb/src/ndbapi/NdbConnectionScan.cpp
+++ b/ndb/src/ndbapi/NdbTransactionScan.cpp
@@ -15,22 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/*****************************************************************************
- * Name: NdbConnectionScan.cpp
- * Include:
- * Link:
- * Author: UABRONM MikaelRonström UAB/M/MT
- * QABJKAM Jonas Kamf UAB/M/MT
- * Date: 2000-06-12
- * Version: 0.1
- * Description: Interface between Application and NDB
- * Documentation:
- * Adjust: 2000-06-12 UABRONM First version.
- ****************************************************************************/
#include <ndb_global.h>
#include <Ndb.hpp>
-#include <NdbConnection.hpp>
+#include <NdbTransaction.hpp>
#include <NdbOperation.hpp>
#include <NdbScanOperation.hpp>
#include "NdbApiSignal.hpp"
@@ -52,7 +40,7 @@
*
****************************************************************************/
int
-NdbConnection::receiveSCAN_TABREF(NdbApiSignal* aSignal){
+NdbTransaction::receiveSCAN_TABREF(NdbApiSignal* aSignal){
const ScanTabRef * ref = CAST_CONSTPTR(ScanTabRef, aSignal->getDataPtr());
if(checkState_TransId(&ref->transId1)){
@@ -93,7 +81,7 @@ NdbConnection::receiveSCAN_TABREF(NdbApiSignal* aSignal){
*
*****************************************************************************/
int
-NdbConnection::receiveSCAN_TABCONF(NdbApiSignal* aSignal,
+NdbTransaction::receiveSCAN_TABCONF(NdbApiSignal* aSignal,
const Uint32 * ops, Uint32 len)
{
const ScanTabConf * conf = CAST_CONSTPTR(ScanTabConf, aSignal->getDataPtr());
diff --git a/ndb/src/ndbapi/Ndberr.cpp b/ndb/src/ndbapi/Ndberr.cpp
index a8b968da03f..07f33d3e8b3 100644
--- a/ndb/src/ndbapi/Ndberr.cpp
+++ b/ndb/src/ndbapi/Ndberr.cpp
@@ -19,7 +19,7 @@
#include "NdbImpl.hpp"
#include "NdbDictionaryImpl.hpp"
#include <NdbOperation.hpp>
-#include <NdbConnection.hpp>
+#include <NdbTransaction.hpp>
#include <NdbBlob.hpp>
@@ -55,7 +55,7 @@ NdbDictionaryImpl::getNdbError() const {
const
NdbError &
-NdbConnection::getNdbError() const {
+NdbTransaction::getNdbError() const {
update(theError);
return theError;
}
diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp
index 12ab85d2895..86be84e0b6c 100644
--- a/ndb/src/ndbapi/Ndbif.cpp
+++ b/ndb/src/ndbapi/Ndbif.cpp
@@ -19,12 +19,11 @@
#include "NdbApiSignal.hpp"
#include "NdbImpl.hpp"
-#include "NdbOperation.hpp"
-#include "NdbIndexOperation.hpp"
-#include "NdbScanOperation.hpp"
-#include "NdbConnection.hpp"
-#include "NdbRecAttr.hpp"
-#include "NdbReceiver.hpp"
+#include <NdbOperation.hpp>
+#include <NdbIndexOperation.hpp>
+#include <NdbScanOperation.hpp>
+#include <NdbRecAttr.hpp>
+#include <NdbReceiver.hpp>
#include "API.hpp"
#include <signaldata/TcCommit.hpp>
@@ -113,9 +112,9 @@ Ndb::init(int aMaxNoOfTransactions)
}//if
theMaxNoOfTransactions = tMaxNoOfTransactions;
- thePreparedTransactionsArray = new NdbConnection* [tMaxNoOfTransactions];
- theSentTransactionsArray = new NdbConnection* [tMaxNoOfTransactions];
- theCompletedTransactionsArray = new NdbConnection* [tMaxNoOfTransactions];
+ thePreparedTransactionsArray = new NdbTransaction* [tMaxNoOfTransactions];
+ theSentTransactionsArray = new NdbTransaction* [tMaxNoOfTransactions];
+ theCompletedTransactionsArray = new NdbTransaction* [tMaxNoOfTransactions];
if ((thePreparedTransactionsArray == NULL) ||
(theSentTransactionsArray == NULL) ||
@@ -271,11 +270,11 @@ Ndb::abortTransactionsAfterNodeFailure(Uint16 aNodeId)
{
Uint32 tNoSentTransactions = theNoOfSentTransactions;
for (int i = tNoSentTransactions - 1; i >= 0; i--) {
- NdbConnection* localCon = theSentTransactionsArray[i];
+ NdbTransaction* localCon = theSentTransactionsArray[i];
if (localCon->getConnectedNodeId() == aNodeId) {
- const NdbConnection::SendStatusType sendStatus = localCon->theSendStatus;
- if (sendStatus == NdbConnection::sendTC_OP ||
- sendStatus == NdbConnection::sendTC_COMMIT) {
+ const NdbTransaction::SendStatusType sendStatus = localCon->theSendStatus;
+ if (sendStatus == NdbTransaction::sendTC_OP ||
+ sendStatus == NdbTransaction::sendTC_COMMIT) {
/*
A transaction was interrupted in the prepare phase by a node
failure. Since the transaction was not found in the phase
@@ -283,13 +282,13 @@ Ndb::abortTransactionsAfterNodeFailure(Uint16 aNodeId)
we report a normal node failure abort.
*/
localCon->setOperationErrorCodeAbort(4010);
- localCon->theCompletionStatus = NdbConnection::CompletedFailure;
- } else if (sendStatus == NdbConnection::sendTC_ROLLBACK) {
+ localCon->theCompletionStatus = NdbTransaction::CompletedFailure;
+ } else if (sendStatus == NdbTransaction::sendTC_ROLLBACK) {
/*
We aimed for abort and abort we got even if it was by a node
failure. We will thus report it as a success.
*/
- localCon->theCompletionStatus = NdbConnection::CompletedSuccess;
+ localCon->theCompletionStatus = NdbTransaction::CompletedSuccess;
} else {
#ifdef VM_TRACE
printState("abortTransactionsAfterNodeFailure %x", this);
@@ -301,8 +300,8 @@ Ndb::abortTransactionsAfterNodeFailure(Uint16 aNodeId)
intact since the node was failing and they were aborted. Thus we
set commit state to Aborted and set state to release on close.
*/
- localCon->theReturnStatus = NdbConnection::ReturnFailure;
- localCon->theCommitStatus = NdbConnection::Aborted;
+ localCon->theReturnStatus = NdbTransaction::ReturnFailure;
+ localCon->theCommitStatus = NdbTransaction::Aborted;
localCon->theReleaseOnClose = true;
completedTransaction(localCon);
}
@@ -325,7 +324,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
{
NdbOperation* tOp;
NdbIndexOperation* tIndexOp;
- NdbConnection* tCon;
+ NdbTransaction* tCon;
int tReturnCode = -1;
const Uint32* tDataPtr = aSignal->getDataPtr();
const Uint32 tWaitState = theWaiter.m_state;
@@ -355,14 +354,14 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == NdbConnection::sendTC_OP)) {
+ (tCon->theSendStatus == NdbTransaction::sendTC_OP)) {
tReturnCode = tCon->receiveTCKEYCONF(keyConf, tLen);
if (tReturnCode != -1) {
completedTransaction(tCon);
}//if
if(TcKeyConf::getMarkerFlag(keyConf->confInfo)){
- NdbConnection::sendTC_COMMIT_ACK(theCommitAckSignal,
+ NdbTransaction::sendTC_COMMIT_ACK(theCommitAckSignal,
keyConf->transId1,
keyConf->transId2,
aTCRef);
@@ -426,8 +425,8 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber(false) == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if ((tCon->theSendStatus == NdbConnection::sendTC_OP) ||
- (tCon->theSendStatus == NdbConnection::sendTC_COMMIT)) {
+ if ((tCon->theSendStatus == NdbTransaction::sendTC_OP) ||
+ (tCon->theSendStatus == NdbTransaction::sendTC_COMMIT)) {
tReturnCode = tCon->receiveTCKEY_FAILCONF(failConf);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -441,7 +440,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
#endif
}
if(tFirstData & 1){
- NdbConnection::sendTC_COMMIT_ACK(theCommitAckSignal,
+ NdbTransaction::sendTC_COMMIT_ACK(theCommitAckSignal,
failConf->transId1,
failConf->transId2,
aTCRef);
@@ -456,8 +455,8 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if ((tCon->theSendStatus == NdbConnection::sendTC_OP) ||
- (tCon->theSendStatus == NdbConnection::sendTC_ROLLBACK)) {
+ if ((tCon->theSendStatus == NdbTransaction::sendTC_OP) ||
+ (tCon->theSendStatus == NdbTransaction::sendTC_ROLLBACK)) {
tReturnCode = tCon->receiveTCKEY_FAILREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -482,7 +481,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if (tCon->theSendStatus == NdbConnection::sendTC_OP) {
+ if (tCon->theSendStatus == NdbTransaction::sendTC_OP) {
tReturnCode = tOp->receiveTCKEYREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -505,14 +504,14 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == NdbConnection::sendTC_COMMIT)) {
+ (tCon->theSendStatus == NdbTransaction::sendTC_COMMIT)) {
tReturnCode = tCon->receiveTC_COMMITCONF(commitConf);
if (tReturnCode != -1) {
completedTransaction(tCon);
}//if
if(tFirstData & 1){
- NdbConnection::sendTC_COMMIT_ACK(theCommitAckSignal,
+ NdbTransaction::sendTC_COMMIT_ACK(theCommitAckSignal,
commitConf->transId1,
commitConf->transId2,
aTCRef);
@@ -530,7 +529,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == NdbConnection::sendTC_COMMIT)) {
+ (tCon->theSendStatus == NdbTransaction::sendTC_COMMIT)) {
tReturnCode = tCon->receiveTC_COMMITREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -545,7 +544,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == NdbConnection::sendTC_ROLLBACK)) {
+ (tCon->theSendStatus == NdbTransaction::sendTC_ROLLBACK)) {
tReturnCode = tCon->receiveTCROLLBACKCONF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -560,7 +559,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == NdbConnection::sendTC_ROLLBACK)) {
+ (tCon->theSendStatus == NdbTransaction::sendTC_ROLLBACK)) {
tReturnCode = tCon->receiveTCROLLBACKREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -797,7 +796,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
const BlockReference aTCRef = aSignal->theSendersBlockRef;
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == NdbConnection::sendTC_OP)) {
+ (tCon->theSendStatus == NdbTransaction::sendTC_OP)) {
tReturnCode = tCon->receiveTCINDXCONF(indxConf, tLen);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -805,7 +804,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
}//if
if(TcIndxConf::getMarkerFlag(indxConf->confInfo)){
- NdbConnection::sendTC_COMMIT_ACK(theCommitAckSignal,
+ NdbTransaction::sendTC_COMMIT_ACK(theCommitAckSignal,
indxConf->transId1,
indxConf->transId2,
aTCRef);
@@ -820,7 +819,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tIndexOp->checkMagicNumber() == 0) {
tCon = tIndexOp->theNdbCon;
if (tCon != NULL) {
- if (tCon->theSendStatus == NdbConnection::sendTC_OP) {
+ if (tCon->theSendStatus == NdbTransaction::sendTC_OP) {
tReturnCode = tIndexOp->receiveTCINDXREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -861,7 +860,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
/*****************************************************************************
-void completedTransaction(NdbConnection* aCon);
+void completedTransaction(NdbTransaction* aCon);
Remark: One transaction has been completed.
Remove it from send array and put it into the completed
@@ -869,14 +868,14 @@ Remark: One transaction has been completed.
up a poller.
******************************************************************************/
void
-Ndb::completedTransaction(NdbConnection* aCon)
+Ndb::completedTransaction(NdbTransaction* aCon)
{
Uint32 tTransArrayIndex = aCon->theTransArrayIndex;
Uint32 tNoSentTransactions = theNoOfSentTransactions;
Uint32 tNoCompletedTransactions = theNoOfCompletedTransactions;
- if ((tNoSentTransactions > 0) && (aCon->theListState == NdbConnection::InSendList) &&
+ if ((tNoSentTransactions > 0) && (aCon->theListState == NdbTransaction::InSendList) &&
(tTransArrayIndex < tNoSentTransactions)) {
- NdbConnection* tMoveCon = theSentTransactionsArray[tNoSentTransactions - 1];
+ NdbTransaction* tMoveCon = theSentTransactionsArray[tNoSentTransactions - 1];
theCompletedTransactionsArray[tNoCompletedTransactions] = aCon;
aCon->theTransArrayIndex = tNoCompletedTransactions;
@@ -888,7 +887,7 @@ Ndb::completedTransaction(NdbConnection* aCon)
theNoOfCompletedTransactions = tNoCompletedTransactions + 1;
theNoOfSentTransactions = tNoSentTransactions - 1;
- aCon->theListState = NdbConnection::InCompletedList;
+ aCon->theListState = NdbTransaction::InCompletedList;
aCon->handleExecuteCompletion();
if ((theMinNoOfEventsToWakeUp != 0) &&
(theNoOfCompletedTransactions >= theMinNoOfEventsToWakeUp)) {
@@ -909,12 +908,12 @@ Ndb::completedTransaction(NdbConnection* aCon)
}//Ndb::completedTransaction()
/*****************************************************************************
-void reportCallback(NdbConnection** aCopyArray, Uint32 aNoOfCompletedTrans);
+void reportCallback(NdbTransaction** aCopyArray, Uint32 aNoOfCompletedTrans);
Remark: Call the callback methods of the completed transactions.
******************************************************************************/
void
-Ndb::reportCallback(NdbConnection** aCopyArray, Uint32 aNoOfCompletedTrans)
+Ndb::reportCallback(NdbTransaction** aCopyArray, Uint32 aNoOfCompletedTrans)
{
Uint32 i;
if (aNoOfCompletedTrans > 0) {
@@ -923,7 +922,7 @@ Ndb::reportCallback(NdbConnection** aCopyArray, Uint32 aNoOfCompletedTrans)
NdbAsynchCallback aCallback = aCopyArray[i]->theCallbackFunction;
int tResult = 0;
if (aCallback != NULL) {
- if (aCopyArray[i]->theReturnStatus == NdbConnection::ReturnFailure) {
+ if (aCopyArray[i]->theReturnStatus == NdbTransaction::ReturnFailure) {
tResult = -1;
}//if
(*aCallback)(tResult, aCopyArray[i], anyObject);
@@ -933,13 +932,13 @@ Ndb::reportCallback(NdbConnection** aCopyArray, Uint32 aNoOfCompletedTrans)
}//Ndb::reportCallback()
/*****************************************************************************
-Uint32 pollCompleted(NdbConnection** aCopyArray);
+Uint32 pollCompleted(NdbTransaction** aCopyArray);
Remark: Transfer the data from the completed transaction to a local array.
This support is used by a number of the poll-methods.
******************************************************************************/
Uint32
-Ndb::pollCompleted(NdbConnection** aCopyArray)
+Ndb::pollCompleted(NdbTransaction** aCopyArray)
{
check_send_timeout();
Uint32 i;
@@ -947,13 +946,13 @@ Ndb::pollCompleted(NdbConnection** aCopyArray)
if (tNoCompletedTransactions > 0) {
for (i = 0; i < tNoCompletedTransactions; i++) {
aCopyArray[i] = theCompletedTransactionsArray[i];
- if (aCopyArray[i]->theListState != NdbConnection::InCompletedList) {
+ if (aCopyArray[i]->theListState != NdbTransaction::InCompletedList) {
ndbout << "pollCompleted error ";
ndbout << (int) aCopyArray[i]->theListState << endl;
abort();
}//if
theCompletedTransactionsArray[i] = NULL;
- aCopyArray[i]->theListState = NdbConnection::NotInList;
+ aCopyArray[i]->theListState = NdbTransaction::NotInList;
}//for
}//if
theNoOfCompletedTransactions = 0;
@@ -968,7 +967,7 @@ Ndb::check_send_timeout()
the_last_check_time = current_time;
Uint32 no_of_sent = theNoOfSentTransactions;
for (Uint32 i = 0; i < no_of_sent; i++) {
- NdbConnection* a_con = theSentTransactionsArray[i];
+ NdbTransaction* a_con = theSentTransactionsArray[i];
if ((current_time - a_con->theStartTransTime) >
WAITFOR_RESPONSE_TIMEOUT) {
#ifdef VM_TRACE
@@ -979,8 +978,8 @@ Ndb::check_send_timeout()
abort();
#endif
a_con->setOperationErrorCodeAbort(4012);
- a_con->theCommitStatus = NdbConnection::Aborted;
- a_con->theCompletionStatus = NdbConnection::CompletedFailure;
+ a_con->theCommitStatus = NdbTransaction::Aborted;
+ a_con->theCompletionStatus = NdbTransaction::CompletedFailure;
a_con->handleExecuteCompletion();
remove_sent_list(i);
insert_completed_list(a_con);
@@ -996,7 +995,7 @@ Ndb::remove_sent_list(Uint32 list_index)
{
Uint32 last_index = theNoOfSentTransactions - 1;
if (list_index < last_index) {
- NdbConnection* t_con = theSentTransactionsArray[last_index];
+ NdbTransaction* t_con = theSentTransactionsArray[last_index];
theSentTransactionsArray[list_index] = t_con;
}//if
theNoOfSentTransactions = last_index;
@@ -1004,23 +1003,23 @@ Ndb::remove_sent_list(Uint32 list_index)
}
Uint32
-Ndb::insert_completed_list(NdbConnection* a_con)
+Ndb::insert_completed_list(NdbTransaction* a_con)
{
Uint32 no_of_comp = theNoOfCompletedTransactions;
theCompletedTransactionsArray[no_of_comp] = a_con;
theNoOfCompletedTransactions = no_of_comp + 1;
- a_con->theListState = NdbConnection::InCompletedList;
+ a_con->theListState = NdbTransaction::InCompletedList;
a_con->theTransArrayIndex = no_of_comp;
return no_of_comp;
}
Uint32
-Ndb::insert_sent_list(NdbConnection* a_con)
+Ndb::insert_sent_list(NdbTransaction* a_con)
{
Uint32 no_of_sent = theNoOfSentTransactions;
theSentTransactionsArray[no_of_sent] = a_con;
theNoOfSentTransactions = no_of_sent + 1;
- a_con->theListState = NdbConnection::InSendList;
+ a_con->theListState = NdbTransaction::InSendList;
a_con->theTransArrayIndex = no_of_sent;
return no_of_sent;
}
@@ -1052,16 +1051,16 @@ Ndb::sendPrepTrans(int forceSend)
TransporterFacade* tp = TransporterFacade::instance();
Uint32 no_of_prep_trans = theNoOfPreparedTransactions;
for (i = 0; i < no_of_prep_trans; i++) {
- NdbConnection * a_con = thePreparedTransactionsArray[i];
+ NdbTransaction * a_con = thePreparedTransactionsArray[i];
thePreparedTransactionsArray[i] = NULL;
Uint32 node_id = a_con->getConnectedNodeId();
if ((tp->getNodeSequence(node_id) == a_con->theNodeSequence) &&
tp->get_node_alive(node_id) ||
(tp->get_node_stopping(node_id) &&
- ((a_con->theSendStatus == NdbConnection::sendABORT) ||
- (a_con->theSendStatus == NdbConnection::sendABORTfail) ||
- (a_con->theSendStatus == NdbConnection::sendCOMMITstate) ||
- (a_con->theSendStatus == NdbConnection::sendCompleted)))) {
+ ((a_con->theSendStatus == NdbTransaction::sendABORT) ||
+ (a_con->theSendStatus == NdbTransaction::sendABORTfail) ||
+ (a_con->theSendStatus == NdbTransaction::sendCOMMITstate) ||
+ (a_con->theSendStatus == NdbTransaction::sendCompleted)))) {
/*
We will send if
1) Node is alive and sequences are correct OR
@@ -1093,13 +1092,13 @@ Ndb::sendPrepTrans(int forceSend)
again and will thus set the state to Aborted to avoid a more or
less eternal loop of tries.
*/
- if (a_con->theSendStatus == NdbConnection::sendOperations) {
+ if (a_con->theSendStatus == NdbTransaction::sendOperations) {
a_con->setOperationErrorCodeAbort(4021);
- a_con->theCommitStatus = NdbConnection::NeedAbort;
+ a_con->theCommitStatus = NdbTransaction::NeedAbort;
TRACE_DEBUG("Send buffer full and sendOperations");
} else {
a_con->setOperationErrorCodeAbort(4026);
- a_con->theCommitStatus = NdbConnection::Aborted;
+ a_con->theCommitStatus = NdbTransaction::Aborted;
TRACE_DEBUG("Send buffer full, set state to Aborted");
}//if
}//if
@@ -1116,7 +1115,7 @@ Ndb::sendPrepTrans(int forceSend)
*/
TRACE_DEBUG("Abort a transaction when stopping a node");
a_con->setOperationErrorCodeAbort(4023);
- a_con->theCommitStatus = NdbConnection::NeedAbort;
+ a_con->theCommitStatus = NdbTransaction::NeedAbort;
} else {
/*
The node is hard dead and we cannot continue. We will also release
@@ -1126,11 +1125,11 @@ Ndb::sendPrepTrans(int forceSend)
a_con->setOperationErrorCodeAbort(4025);
a_con->theReleaseOnClose = true;
a_con->theTransactionIsStarted = false;
- a_con->theCommitStatus = NdbConnection::Aborted;
+ a_con->theCommitStatus = NdbTransaction::Aborted;
}//if
}//if
- a_con->theReturnStatus = NdbConnection::ReturnFailure;
- a_con->theCompletionStatus = NdbConnection::CompletedFailure;
+ a_con->theReturnStatus = NdbTransaction::ReturnFailure;
+ a_con->theCompletionStatus = NdbTransaction::CompletedFailure;
a_con->handleExecuteCompletion();
insert_completed_list(a_con);
}//for
@@ -1204,7 +1203,7 @@ Remark: First send all prepared operations and then check if there are any
int
Ndb::sendPollNdb(int aMillisecondNumber, int minNoOfEventsToWakeup, int forceSend)
{
- NdbConnection* tConArray[1024];
+ NdbTransaction* tConArray[1024];
Uint32 tNoCompletedTransactions;
//theCurrentConnectCounter = 0;
@@ -1237,7 +1236,7 @@ Remark: Check if there are any transactions already completed. Wait for not
int
Ndb::pollNdb(int aMillisecondNumber, int minNoOfEventsToWakeup)
{
- NdbConnection* tConArray[1024];
+ NdbTransaction* tConArray[1024];
Uint32 tNoCompletedTransactions;
//theCurrentConnectCounter = 0;
@@ -1344,7 +1343,7 @@ Ndb::sendRecSignal(Uint16 node_id,
}//Ndb::sendRecSignal()
void
-NdbConnection::sendTC_COMMIT_ACK(NdbApiSignal * aSignal,
+NdbTransaction::sendTC_COMMIT_ACK(NdbApiSignal * aSignal,
Uint32 transId1, Uint32 transId2,
Uint32 aTCRef){
#ifdef MARKER_TRACE
diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp
index 48e62c36a5f..e6711155a94 100644
--- a/ndb/src/ndbapi/Ndbinit.cpp
+++ b/ndb/src/ndbapi/Ndbinit.cpp
@@ -19,12 +19,12 @@
#include "NdbApiSignal.hpp"
#include "NdbImpl.hpp"
-#include "NdbOperation.hpp"
-#include "NdbConnection.hpp"
-#include "NdbRecAttr.hpp"
-#include "IPCConfig.hpp"
+#include <NdbOperation.hpp>
+#include <NdbTransaction.hpp>
+#include <NdbRecAttr.hpp>
+#include <IPCConfig.hpp>
#include "TransporterFacade.hpp"
-#include "ConfigRetriever.hpp"
+#include <ConfigRetriever.hpp>
#include <ndb_limits.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp
index a5f2a4801d5..499e6ef7ad0 100644
--- a/ndb/src/ndbapi/Ndblist.cpp
+++ b/ndb/src/ndbapi/Ndblist.cpp
@@ -19,7 +19,6 @@
#include <NdbOperation.hpp>
#include <NdbIndexOperation.hpp>
#include <NdbIndexScanOperation.hpp>
-#include <NdbConnection.hpp>
#include "NdbApiSignal.hpp"
#include <NdbRecAttr.hpp>
#include "NdbUtil.hpp"
@@ -43,10 +42,10 @@ Ndb::checkFailedNode()
/**
* Release all connections in idle list (for node)
*/
- NdbConnection * tNdbCon = theConnectionArray[node_id];
+ NdbTransaction * tNdbCon = theConnectionArray[node_id];
theConnectionArray[node_id] = NULL;
while (tNdbCon != NULL) {
- NdbConnection* tempNdbCon = tNdbCon;
+ NdbTransaction* tempNdbCon = tNdbCon;
tNdbCon = tNdbCon->next();
releaseNdbCon(tempNdbCon);
}
@@ -88,14 +87,14 @@ NdbImpl::checkErrorCode(Uint32 i, NdbTableImpl * tab){
* if createConIdleList was succesful
* Return -1: In all other case.
* Parameters: aNrOfCon : Number of connections offered to the application.
- * Remark: Create connection idlelist with NdbConnection objects.
+ * Remark: Create connection idlelist with NdbTransaction objects.
***************************************************************************/
int
Ndb::createConIdleList(int aNrOfCon)
{
for (int i = 0; i < aNrOfCon; i++)
{
- NdbConnection* tNdbCon = new NdbConnection(this);
+ NdbTransaction* tNdbCon = new NdbTransaction(this);
if (tNdbCon == NULL)
{
return -1;
@@ -109,7 +108,7 @@ Ndb::createConIdleList(int aNrOfCon)
tNdbCon->next(theConIdleList);
theConIdleList = tNdbCon;
}
- tNdbCon->Status(NdbConnection::NotConnected);
+ tNdbCon->Status(NdbTransaction::NotConnected);
}
theNoOfAllocatedTransactions = aNrOfCon;
return aNrOfCon;
@@ -200,19 +199,19 @@ Ndb::getNdbCall()
}
/***************************************************************************
- * NdbConnection* getNdbCon();
+ * NdbTransaction* getNdbCon();
*
* Return Value: Return a connection if the getNdbCon was successful.
* Return NULL : In all other case.
* Remark: Get a connection from theConIdleList and return the object .
***************************************************************************/
-NdbConnection*
+NdbTransaction*
Ndb::getNdbCon()
{
- NdbConnection* tNdbCon;
+ NdbTransaction* tNdbCon;
if ( theConIdleList == NULL ) {
if (theNoOfAllocatedTransactions < theMaxNoOfTransactions) {
- tNdbCon = new NdbConnection(this);
+ tNdbCon = new NdbTransaction(this);
if (tNdbCon == NULL) {
return NULL;
}//if
@@ -484,13 +483,13 @@ Ndb::releaseNdbCall(NdbCall* aNdbCall)
}
/***************************************************************************
-void releaseNdbCon(NdbConnection* aNdbCon);
+void releaseNdbCon(NdbTransaction* aNdbCon);
-Parameters: aNdbCon: The NdbConnection object.
+Parameters: aNdbCon: The NdbTransaction object.
Remark: Add a Connection object into the signal idlelist.
***************************************************************************/
void
-Ndb::releaseNdbCon(NdbConnection* aNdbCon)
+Ndb::releaseNdbCon(NdbTransaction* aNdbCon)
{
aNdbCon->next(theConIdleList);
aNdbCon->theMagicNumber = 0xFE11DD;
@@ -720,7 +719,7 @@ Remark: Always release the first item in the free list
void
Ndb::freeNdbCon()
{
- NdbConnection* tNdbCon = theConIdleList;
+ NdbTransaction* tNdbCon = theConIdleList;
theConIdleList = theConIdleList->next();
delete tNdbCon;
}
@@ -789,14 +788,14 @@ Ndb::freeNdbBlob()
}
/****************************************************************************
-int releaseConnectToNdb(NdbConnection* aConnectConnection);
+int releaseConnectToNdb(NdbTransaction* aConnectConnection);
Return Value: -1 if error
Parameters: aConnectConnection : Seized schema connection to DBTC
Remark: Release and disconnect from DBTC a connection and seize it to theConIdleList.
*****************************************************************************/
void
-Ndb::releaseConnectToNdb(NdbConnection* a_con)
+Ndb::releaseConnectToNdb(NdbTransaction* a_con)
{
DBUG_ENTER("Ndb::releaseConnectToNdb");
NdbApiSignal tSignal(theMyRef);
@@ -814,7 +813,7 @@ Ndb::releaseConnectToNdb(NdbConnection* a_con)
tSignal.setData((tConPtr = a_con->getTC_ConnectPtr()), 1);
tSignal.setData(theMyRef, 2);
tSignal.setData(a_con->ptr2int(), 3);
- a_con->Status(NdbConnection::DisConnecting);
+ a_con->Status(NdbTransaction::DisConnecting);
a_con->theMagicNumber = 0x37412619;
int ret_code = sendRecSignal(node_id,
WAIT_TC_RELEASE,