summaryrefslogtreecommitdiff
path: root/ndb/src/ndbapi
diff options
context:
space:
mode:
authorunknown <magnus@neptunus.(none)>2004-05-25 11:53:07 +0200
committerunknown <magnus@neptunus.(none)>2004-05-25 11:53:07 +0200
commitad959d35c270a278099126cfb132717ce65cc083 (patch)
treef542d4418f9afce707a4fe5a728fef5bfcdb1497 /ndb/src/ndbapi
parentc7bd561cc881ce0eb9fea2569419ca2e394444d1 (diff)
downloadmariadb-git-ad959d35c270a278099126cfb132717ce65cc083.tar.gz
Removed AttrType.hpp and moved the "internal" datatypes to their corresponding class.
Moved NdbSchemaCon and NdbSchemaOp out of the public NdbApi, it can however still be used by old test programs. Added print oof indexes to desc. ndb/BinDist.sh: Removed AttrType.hpp from BinDist.sh ndb/include/ndbapi/Ndb.hpp: Removed NdbSchemaCon and NdbSchemaOp includes from public NdbApi Removed AttrType.hpp ndb/include/ndbapi/NdbApi.hpp: Removed NdbSchemaCon and NdbSchemaOp includes from public NdbApi Removed AttrType.hpp ndb/include/ndbapi/NdbConnection.hpp: Removed NdbSchemaCon and NdbSchemaOp includes from public NdbApi Removed AttrType.hpp Moved internal types to the class where they are used ndb/include/ndbapi/NdbIndexOperation.hpp: Use limit from ndbapi_limit.h ndb/include/ndbapi/NdbOperation.hpp: Removed NdbSchemaCon and NdbSchemaOp includes from public NdbApi Removed AttrType.hpp Remove faulty comment about how many attributes a key is allowed to consist of Removed unused member variables ndb/include/ndbapi/NdbRecAttr.hpp: Removed NdbSchemaCon and NdbSchemaOp includes from public NdbApi Removed AttrType.hpp ndb/include/ndbapi/NdbSchemaCon.hpp: Removed NdbSchemaCon and NdbSchemaOp includes from public NdbApi Removed AttrType.hpp ndb/include/ndbapi/NdbSchemaOp.hpp: Removed NdbSchemaCon and NdbSchemaOp includes from public NdbApi Removed AttrType.hpp Moved all "old" datatypes here, so if a test program is still using old type, include NdbSchemaCon.hpp ndb/include/ndbapi/ndbapi_limits.h: Corrected limitations, added some from AttrTyp.hpp ndb/src/Makefile: Remove newtonapi from Makefile ndb/src/kernel/blocks/backup/restore/Restore.hpp: Removed AttrType Include NdbSchemaCon since restore uses old types ndb/src/kernel/blocks/backup/restore/main.cpp: Include NdbOut ndb/src/mgmsrv/MgmtSrvr.cpp: Remov AttrType.hpp ndb/src/ndbapi/ClusterMgr.cpp: Remov AttrType.hpp ndb/src/ndbapi/Ndb.cpp: Removed NdbSchemaCon and NdbSchemaOp includes from public NdbApi Removed AttrType.hpp Moved internal types to the class where they are used ndb/src/ndbapi/NdbApiSignal.cpp: Removed AttrType.hpp ndb/src/ndbapi/NdbApiSignal.hpp: Removed AttrType.hpp ndb/src/ndbapi/NdbConnection.cpp: Moved internal type s to the class where they belong ndb/src/ndbapi/NdbDictionaryImpl.cpp: RemovedAttrType.hpp Use limits from ndbapi_limits.h ndb/src/ndbapi/NdbEventOperationImpl.cpp: Removed AttrType.hpp Moved printRecAttr to end since it depends on old types and need to include "NdbSchemaCon", function will be rewritten and moved to NdbRecAttr. It's also useful from other places where an attribute has been read into an NdbRecAttr. ndb/src/ndbapi/NdbIndexOperation.cpp: Use limitations from ndbapi_limits.h Moved internal tyeps to the class where they belongs ndb/src/ndbapi/NdbOperation.cpp: Use limits from ndbapi_limits.h ndb/src/ndbapi/NdbOperationDefine.cpp: Remove AttrType.hpp ndb/src/ndbapi/NdbOperationExec.cpp: Moved internal tyeps to the class where they belongs ndb/src/ndbapi/NdbOperationInt.cpp: RemovedAttrType.hpp Use limits from ndbapi_limits.h ndb/src/ndbapi/NdbOperationScan.cpp: RemovedAttrType.hpp Use limits from ndbapi_limits.h ndb/src/ndbapi/NdbOperationSearch.cpp: Removed AttrType.hpp Use limits from ndbapi_limits.h ndb/src/ndbapi/NdbResultSet.cpp: Moved the "internal" types to corresponding class ndb/src/ndbapi/NdbSchemaCon.cpp: Updated not to be included in public NdbApi ndb/src/ndbapi/NdbSchemaOp.cpp: Updated not to be included in public NdbApi ndb/src/ndbapi/NdbUtil.hpp: Removed AttrType.hpp ndb/src/ndbapi/Ndbif.cpp: Removed AttrType.hpp Removed NdbSchemaCon and NdbSchemaOp from public NdbApi Moved "interal" types to their corresponding class ndb/src/ndbapi/Ndbinit.cpp: Removed NdbSchemaCon and NdbSchemaOp from public NdbApi ndb/src/ndbapi/Ndblist.cpp: Removed NdbSchemaCon and NdbSchemaOp from public NdbApi Moved "internal" types to their corresponding class ndb/src/ndbapi/TransporterFacade.cpp: Removed AttrType.hpp ndb/src/ndbapi/TransporterFacade.hpp: Removed AttrType.hpp Moved internal definition of how many Ndb objects to create to here ndb/test/include/NDBT_Table.hpp: Removed old NdbSchema* Added function to print information about an index ndb/test/ndbapi/acid/acid.cpp: This test program uses old NdbScheaCon.hpp ndb/test/ndbapi/flexAsynch/flexAsynch.cpp: This test program uses old NdbScheaCon.hpp ndb/test/ndbapi/flexScan/flexScan.cpp: This test program uses old NdbScheaCon.hpp ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp: This test program uses old NdbScheaCon.hpp ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp: This test program uses old NdbScheaCon.hpp ndb/test/ndbapi/ronja/initronja/initronja.cpp: This test program uses old NdbScheaCon.hpp ndb/test/ndbapi/telco/msa.cpp: This test program uses old NdbScheaCon.hpp ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp: This test program uses old NdbScheaCon.hpp ndb/test/ndbapi/testNdbApi/testNdbApi.cpp: Remove AttrType.hpp Define max number of Ndb objects test should "try" to create. ndb/test/ndbapi/testRestartGci/testRestartGci.cpp: Moved "internal" datatypes to corresponding class, in this case Ndb class ndb/test/src/NDBT_ResultRow.cpp: This test program uses old NdbScheaCon.hpp But should soon use "printer" from NdbRecAttr ndb/test/src/NDBT_Table.cpp: Print table info more SQL like ndb/test/src/UtilTransactions.cpp: When AttrType.hpp, this hidden bug was discovered. Using wrong enum types in switch. ndb/tools/desc/desc.cpp: Alos print info about indexes for a table
Diffstat (limited to 'ndb/src/ndbapi')
-rw-r--r--ndb/src/ndbapi/ClusterMgr.cpp1
-rw-r--r--ndb/src/ndbapi/Ndb.cpp15
-rw-r--r--ndb/src/ndbapi/NdbApiSignal.cpp1
-rw-r--r--ndb/src/ndbapi/NdbApiSignal.hpp1
-rw-r--r--ndb/src/ndbapi/NdbConnection.cpp2
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.cpp3
-rw-r--r--ndb/src/ndbapi/NdbEventOperationImpl.cpp103
-rw-r--r--ndb/src/ndbapi/NdbIndexOperation.cpp6
-rw-r--r--ndb/src/ndbapi/NdbOperation.cpp4
-rw-r--r--ndb/src/ndbapi/NdbOperationDefine.cpp1
-rw-r--r--ndb/src/ndbapi/NdbOperationExec.cpp2
-rw-r--r--ndb/src/ndbapi/NdbOperationInt.cpp13
-rw-r--r--ndb/src/ndbapi/NdbOperationScan.cpp8
-rw-r--r--ndb/src/ndbapi/NdbOperationSearch.cpp3
-rw-r--r--ndb/src/ndbapi/NdbResultSet.cpp12
-rw-r--r--ndb/src/ndbapi/NdbSchemaCon.cpp23
-rw-r--r--ndb/src/ndbapi/NdbSchemaOp.cpp21
-rw-r--r--ndb/src/ndbapi/NdbUtil.hpp1
-rw-r--r--ndb/src/ndbapi/Ndbif.cpp94
-rw-r--r--ndb/src/ndbapi/Ndbinit.cpp12
-rw-r--r--ndb/src/ndbapi/Ndblist.cpp8
-rw-r--r--ndb/src/ndbapi/TransporterFacade.cpp1
-rw-r--r--ndb/src/ndbapi/TransporterFacade.hpp7
23 files changed, 185 insertions, 157 deletions
diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp
index 1b536b6d741..57967e5534f 100644
--- a/ndb/src/ndbapi/ClusterMgr.cpp
+++ b/ndb/src/ndbapi/ClusterMgr.cpp
@@ -21,7 +21,6 @@
#include "TransporterFacade.hpp"
#include "ClusterMgr.hpp"
#include <IPCConfig.hpp>
-#include "AttrType.hpp"
#include "NdbApiSignal.hpp"
#include "API.hpp"
#include <NdbSleep.h>
diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp
index 448a29ca485..0304db67a39 100644
--- a/ndb/src/ndbapi/Ndb.cpp
+++ b/ndb/src/ndbapi/Ndb.cpp
@@ -26,8 +26,6 @@ Name: Ndb.cpp
#include "NdbApiSignal.hpp"
#include "NdbImpl.hpp"
-#include "NdbSchemaOp.hpp"
-#include "NdbSchemaCon.hpp"
#include <NdbOperation.hpp>
#include <NdbConnection.hpp>
#include <NdbEventOperation.hpp>
@@ -155,7 +153,7 @@ Ndb::NDB_connect(Uint32 tNode)
// Set connection pointer as NdbConnection object
//************************************************
tSignal->setData(theMyRef, 2); // Set my block reference
- tNdbCon->Status(Connecting); // Set status to connecting
+ tNdbCon->Status(NdbConnection::Connecting); // Set status to connecting
Uint32 nodeSequence;
{ // send and receive signal
tp->lock_mutex();
@@ -178,7 +176,7 @@ Ndb::NDB_connect(Uint32 tNode)
}//if
}
- if ((tReturnCode == 0) && (tNdbCon->Status() == Connected)) {
+ if ((tReturnCode == 0) && (tNdbCon->Status() == NdbConnection::Connected)) {
//************************************************
// Send and receive was successful
//************************************************
@@ -434,7 +432,7 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId)
theFirstTransId = tFirstTransId + 1;
}//if
#ifdef VM_TRACE
- if (tConnection->theListState != NotInList) {
+ if (tConnection->theListState != NdbConnection::NotInList) {
printState("startTransactionLocal %x", tConnection);
abort();
}
@@ -589,7 +587,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(Connecting); // Set status to connecting
+ tNdbConn->Status(NdbConnection::Connecting); // Set status to connecting
TransporterFacade *tp = TransporterFacade::instance();
if (tAction == 3) {
tp->lock_mutex();
@@ -622,7 +620,7 @@ Ndb::NdbTamper(TamperType aAction, int aNode)
}//if
ret_code = sendRecSignal(tNode, WAIT_NDB_TAMPER, &tSignal, 0);
if (ret_code == 0) {
- if (tNdbConn->Status() != Connected) {
+ if (tNdbConn->Status() != NdbConnection::Connected) {
theRestartGCI = 0;
}//if
releaseNdbCon(tNdbConn);
@@ -637,6 +635,7 @@ Ndb::NdbTamper(TamperType aAction, int aNode)
return 0;
#endif
}
+#if 0
/****************************************************************************
NdbSchemaCon* startSchemaTransaction();
@@ -678,7 +677,7 @@ Ndb::closeSchemaTransaction(NdbSchemaCon* aSchemaCon)
theSchemaConToNdbList = NULL;
return;
}//Ndb::closeSchemaTransaction()
-
+#endif
/*****************************************************************************
void RestartGCI(int aRestartGCI);
diff --git a/ndb/src/ndbapi/NdbApiSignal.cpp b/ndb/src/ndbapi/NdbApiSignal.cpp
index a9cd5b1d53a..a44937cd398 100644
--- a/ndb/src/ndbapi/NdbApiSignal.cpp
+++ b/ndb/src/ndbapi/NdbApiSignal.cpp
@@ -29,7 +29,6 @@ Adjust: 971114 UABMNST First version.
******************************************************************************/
#include "API.hpp"
#include "NdbApiSignal.hpp"
-#include <AttrType.hpp>
/**
* The following include includes
diff --git a/ndb/src/ndbapi/NdbApiSignal.hpp b/ndb/src/ndbapi/NdbApiSignal.hpp
index 76cefe0e882..9d5bc0847be 100644
--- a/ndb/src/ndbapi/NdbApiSignal.hpp
+++ b/ndb/src/ndbapi/NdbApiSignal.hpp
@@ -31,7 +31,6 @@
#define NdbApiSignal_H
#include <kernel_types.h>
-#include "AttrType.hpp"
#include "TransporterFacade.hpp"
#include <TransporterDefinitions.hpp>
#include "Ndb.hpp"
diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp
index 4ec098c3c60..fbfd0e99238 100644
--- a/ndb/src/ndbapi/NdbConnection.cpp
+++ b/ndb/src/ndbapi/NdbConnection.cpp
@@ -1706,7 +1706,7 @@ NdbConnection::getTransactionId()
return theTransactionId;
}//NdbConnection::getTransactionId()
-CommitStatusType
+NdbConnection::CommitStatusType
NdbConnection::commitStatus()
{
return theCommitStatus;
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index 02e3ee23f9c..1a7147c5b21 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -17,7 +17,6 @@
#include "NdbDictionaryImpl.hpp"
#include "API.hpp"
#include <NdbOut.hpp>
-#include <AttrType.hpp>
#include "NdbApiSignal.hpp"
#include "TransporterFacade.hpp"
#include <signaldata/GetTabInfo.hpp>
@@ -1257,7 +1256,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
NdbTableImpl & impl,
bool alter)
{
- if((unsigned)impl.getNoOfPrimaryKeys() > MAXNROFTUPLEKEY){
+ if((unsigned)impl.getNoOfPrimaryKeys() > NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY){
m_error.code = 4317;
return -1;
}
diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/ndb/src/ndbapi/NdbEventOperationImpl.cpp
index acc726e28c5..7b4afc72ef7 100644
--- a/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+++ b/ndb/src/ndbapi/NdbEventOperationImpl.cpp
@@ -21,7 +21,6 @@
#include "NdbDictionaryImpl.hpp"
#include "API.hpp"
#include <NdbOut.hpp>
-#include <AttrType.hpp>
#include "NdbApiSignal.hpp"
#include "TransporterFacade.hpp"
#include <signaldata/CreateEvnt.hpp>
@@ -489,52 +488,7 @@ NdbEventOperationImpl::getEventType()
}
}
-void
-NdbEventOperationImpl::printRecAttr(NdbRecAttr *p)
-{
- int size = p->attrSize();
- int aSize = p->arraySize();
- switch(p->attrType()){
- case UnSigned:
- switch(size) {
- case 8: ndbout << p->u_64_value(); break;
- case 4: ndbout << p->u_32_value(); break;
- case 2: ndbout << p->u_short_value(); break;
- case 1: ndbout << (unsigned) p->u_char_value(); break;
- default: ndbout << "Unknown size" << endl;
- }
- break;
-
- case Signed:
- switch(size) {
- case 8: ndbout << p->int64_value(); break;
- case 4: ndbout << p->int32_value(); break;
- case 2: ndbout << p->short_value(); break;
- case 1: ndbout << (int) p->char_value(); break;
- default: ndbout << "Unknown size" << endl;
- }
- break;
-
- case String:
- {
- char* buf = new char[aSize+1];
- memcpy(buf, p->aRef(), aSize);
- buf[aSize] = 0;
- ndbout << buf;
- delete [] buf;
- }
- break;
-
- case Float:
- ndbout << p->float_value();
- break;
-
- default:
- ndbout << "Unknown";
- break;
- }
-}
void
NdbEventOperationImpl::print()
@@ -1294,3 +1248,60 @@ NdbGlobalEventBuffer::real_wait(NdbGlobalEventBufferHandle *h,
n += hasData(h->m_bufferIds[i]);
return n;
}
+
+/**
+ * TODO Change this function to use the real datatypes
+ * from NdbDictionary alternatively make a
+ * "printer" in NdbRecAttr that can be used from all programs
+ */
+
+// and remove this include
+#include "NdbSchemaOp.hpp"
+void
+NdbEventOperationImpl::printRecAttr(NdbRecAttr *p)
+{
+ int size = p->attrSize();
+ int aSize = p->arraySize();
+
+
+ switch(convertColumnTypeToAttrType(p->getType())){
+ case UnSigned:
+ switch(size) {
+ case 8: ndbout << p->u_64_value(); break;
+ case 4: ndbout << p->u_32_value(); break;
+ case 2: ndbout << p->u_short_value(); break;
+ case 1: ndbout << (unsigned) p->u_char_value(); break;
+ default: ndbout << "Unknown size" << endl;
+ }
+ break;
+
+ case Signed:
+ switch(size) {
+ case 8: ndbout << p->int64_value(); break;
+ case 4: ndbout << p->int32_value(); break;
+ case 2: ndbout << p->short_value(); break;
+ case 1: ndbout << (int) p->char_value(); break;
+ default: ndbout << "Unknown size" << endl;
+ }
+ break;
+
+ case String:
+ {
+ char* buf = new char[aSize+1];
+ memcpy(buf, p->aRef(), aSize);
+ buf[aSize] = 0;
+ ndbout << buf;
+ delete [] buf;
+ }
+ break;
+
+ case Float:
+ ndbout << p->float_value();
+ break;
+
+ default:
+ ndbout << "Unknown";
+ break;
+ }
+
+}
diff --git a/ndb/src/ndbapi/NdbIndexOperation.cpp b/ndb/src/ndbapi/NdbIndexOperation.cpp
index ee5491d72a8..02d94f39f2d 100644
--- a/ndb/src/ndbapi/NdbIndexOperation.cpp
+++ b/ndb/src/ndbapi/NdbIndexOperation.cpp
@@ -87,7 +87,7 @@ NdbIndexOperation::indxInit(NdbIndexImpl * anIndex,
m_accessTable = anIndex->m_table;
m_theIndexLen = 0;
m_theNoOfIndexDefined = 0;
- for (Uint32 i=0; i<MAXNROFTUPLEKEY; i++)
+ for (Uint32 i=0; i<NDB_MAX_ATTRIBUTES_IN_INDEX; i++)
for (int j=0; j<3; j++)
m_theIndexDefined[i][j] = false;
@@ -221,7 +221,7 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
goto equal_error2;
}//if
}//if
- } while (i < MAXNROFTUPLEKEY);
+ } while (i < NDB_MAX_ATTRIBUTES_IN_INDEX);
goto equal_error2;
} else {
goto equal_error1;
@@ -695,7 +695,7 @@ NdbIndexOperation::receiveTCINDXREF( NdbApiSignal* aSignal)
theStatus = Finished;
- theNdbCon->theReturnStatus = ReturnFailure;
+ theNdbCon->theReturnStatus = NdbConnection::ReturnFailure;
//--------------------------------------------------------------------------//
// If the transaction this operation belongs to consists only of simple reads
// we set the error code on the transaction object.
diff --git a/ndb/src/ndbapi/NdbOperation.cpp b/ndb/src/ndbapi/NdbOperation.cpp
index ccbfa767542..8bc9111d060 100644
--- a/ndb/src/ndbapi/NdbOperation.cpp
+++ b/ndb/src/ndbapi/NdbOperation.cpp
@@ -31,7 +31,7 @@
#include "NdbApiSignal.hpp"
#include "NdbRecAttr.hpp"
#include "NdbUtil.hpp"
-
+#include "ndbapi_limits.h"
#include <signaldata/TcKeyReq.hpp>
#include "NdbDictionaryImpl.hpp"
@@ -163,7 +163,7 @@ NdbOperation::init(NdbTableImpl* tab, NdbConnection* myConnection){
m_currentTable = m_accessTable = tab;
theNdbCon = myConnection;
- for (Uint32 i=0; i<MAXNROFTUPLEKEY; i++)
+ for (Uint32 i=0; i<NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY; i++)
for (int j=0; j<3; j++)
theTupleKeyDefined[i][j] = false;
diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp
index 18f8b79d12e..20134068075 100644
--- a/ndb/src/ndbapi/NdbOperationDefine.cpp
+++ b/ndb/src/ndbapi/NdbOperationDefine.cpp
@@ -31,7 +31,6 @@
#include "NdbConnection.hpp"
#include "Ndb.hpp"
#include "NdbRecAttr.hpp"
-#include "AttrType.hpp"
#include "NdbUtil.hpp"
#include "NdbOut.hpp"
#include "NdbImpl.hpp"
diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp
index b2a6f99880c..d00c527550d 100644
--- a/ndb/src/ndbapi/NdbOperationExec.cpp
+++ b/ndb/src/ndbapi/NdbOperationExec.cpp
@@ -757,7 +757,7 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal)
theStatus = Finished;
- theNdbCon->theReturnStatus = ReturnFailure;
+ theNdbCon->theReturnStatus = NdbConnection::ReturnFailure;
//-------------------------------------------------------------------------//
// If the transaction this operation belongs to consists only of simple reads
// we set the error code on the transaction object.
diff --git a/ndb/src/ndbapi/NdbOperationInt.cpp b/ndb/src/ndbapi/NdbOperationInt.cpp
index be23a1c274c..e61fc5b05d7 100644
--- a/ndb/src/ndbapi/NdbOperationInt.cpp
+++ b/ndb/src/ndbapi/NdbOperationInt.cpp
@@ -31,7 +31,6 @@ Adjust: 991029 UABRONM First version.
#include "NdbConnection.hpp"
#include "Ndb.hpp"
#include "NdbRecAttr.hpp"
-#include "AttrType.hpp"
#include "NdbUtil.hpp"
#include "Interpreter.hpp"
@@ -69,7 +68,7 @@ NdbOperation::incCheck(const NdbColumnImpl* tNdbColumnImpl)
}
return tNdbColumnImpl->m_attrId;
} else {
- if (theNdbCon->theCommitStatus == Started)
+ if (theNdbCon->theCommitStatus == NdbConnection::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -121,7 +120,7 @@ NdbOperation::write_attrCheck(const NdbColumnImpl* tNdbColumnImpl)
}
return tNdbColumnImpl->m_attrId;
} else {
- if (theNdbCon->theCommitStatus == Started)
+ if (theNdbCon->theCommitStatus == NdbConnection::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -169,7 +168,7 @@ NdbOperation::read_attrCheck(const NdbColumnImpl* tNdbColumnImpl)
}
return tNdbColumnImpl->m_attrId;
} else {
- if (theNdbCon->theCommitStatus == Started)
+ if (theNdbCon->theCommitStatus == NdbConnection::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -209,7 +208,7 @@ NdbOperation::initial_interpreterCheck()
}
return 0;
} else {
- if (theNdbCon->theCommitStatus == Started)
+ if (theNdbCon->theCommitStatus == NdbConnection::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -235,7 +234,7 @@ NdbOperation::labelCheck()
}
return 0;
} else {
- if (theNdbCon->theCommitStatus == Started)
+ if (theNdbCon->theCommitStatus == NdbConnection::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -255,7 +254,7 @@ NdbOperation::intermediate_interpreterCheck()
}
return 0;
} else {
- if (theNdbCon->theCommitStatus == Started)
+ if (theNdbCon->theCommitStatus == NdbConnection::Started)
setErrorCodeAbort(4200);
}
return -1;
diff --git a/ndb/src/ndbapi/NdbOperationScan.cpp b/ndb/src/ndbapi/NdbOperationScan.cpp
index df4f2421ec0..0c377d3fd98 100644
--- a/ndb/src/ndbapi/NdbOperationScan.cpp
+++ b/ndb/src/ndbapi/NdbOperationScan.cpp
@@ -31,7 +31,7 @@ NdbOperation::openScanRead(Uint32 aParallelism)
{
aParallelism = checkParallelism(aParallelism);
- if ((theNdbCon->theCommitStatus != Started) &&
+ if ((theNdbCon->theCommitStatus != NdbConnection::Started) &&
(theStatus != Init) &&
(aParallelism == 0)) {
setErrorCode(4200);
@@ -48,7 +48,7 @@ NdbOperation::openScanExclusive(Uint32 aParallelism)
{
aParallelism = checkParallelism(aParallelism);
- if ((theNdbCon->theCommitStatus != Started) &&
+ if ((theNdbCon->theCommitStatus != NdbConnection::Started) &&
(theStatus != Init) &&
(aParallelism == 0)) {
setErrorCode(4200);
@@ -65,7 +65,7 @@ NdbOperation::openScanReadHoldLock(Uint32 aParallelism)
{
aParallelism = checkParallelism(aParallelism);
- if ((theNdbCon->theCommitStatus != Started) &&
+ if ((theNdbCon->theCommitStatus != NdbConnection::Started) &&
(theStatus != Init) &&
(aParallelism == 0)) {
setErrorCode(4200);
@@ -82,7 +82,7 @@ NdbOperation::openScanReadCommitted(Uint32 aParallelism)
{
aParallelism = checkParallelism(aParallelism);
- if ((theNdbCon->theCommitStatus != Started) &&
+ if ((theNdbCon->theCommitStatus != NdbConnection::Started) &&
(theStatus != Init) &&
(aParallelism == 0)) {
setErrorCode(4200);
diff --git a/ndb/src/ndbapi/NdbOperationSearch.cpp b/ndb/src/ndbapi/NdbOperationSearch.cpp
index e1d5e823077..8b9b89dcf07 100644
--- a/ndb/src/ndbapi/NdbOperationSearch.cpp
+++ b/ndb/src/ndbapi/NdbOperationSearch.cpp
@@ -35,7 +35,6 @@ Adjust: 971022 UABMNST First version.
#include <Ndb.hpp>
#include "NdbImpl.hpp"
#include <NdbOut.hpp>
-#include "AttrType.hpp"
#include <AttributeHeader.hpp>
#include <signaldata/TcKeyReq.hpp>
@@ -102,7 +101,7 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
goto equal_error2;
}//if
}//if
- } while (i < MAXNROFTUPLEKEY);
+ } while (i < NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY);
goto equal_error2;
} else {
goto equal_error1;
diff --git a/ndb/src/ndbapi/NdbResultSet.cpp b/ndb/src/ndbapi/NdbResultSet.cpp
index 8397d5eef91..65ed43f60d8 100644
--- a/ndb/src/ndbapi/NdbResultSet.cpp
+++ b/ndb/src/ndbapi/NdbResultSet.cpp
@@ -61,7 +61,8 @@ NdbResultSet::updateTuple(){
}
NdbScanOperation * op = (NdbScanOperation*)(m_operation);
- return op->takeOverScanOp(UpdateRequest, op->m_transConnection);
+ return op->takeOverScanOp(NdbOperation::UpdateRequest,
+ op->m_transConnection);
}
NdbOperation*
@@ -71,7 +72,8 @@ NdbResultSet::updateTuple(NdbConnection* takeOverTrans){
return 0;
}
- return m_operation->takeOverScanOp(UpdateRequest, takeOverTrans);
+ return m_operation->takeOverScanOp(NdbOperation::UpdateRequest,
+ takeOverTrans);
}
int
@@ -82,7 +84,8 @@ NdbResultSet::deleteTuple(){
}
NdbScanOperation * op = (NdbScanOperation*)(m_operation);
- void * res = op->takeOverScanOp(DeleteRequest, op->m_transConnection);
+ void * res = op->takeOverScanOp(NdbOperation::DeleteRequest,
+ op->m_transConnection);
if(res == 0)
return -1;
return 0;
@@ -95,7 +98,8 @@ NdbResultSet::deleteTuple(NdbConnection * takeOverTrans){
return 0;
}
- void * res = m_operation->takeOverScanOp(DeleteRequest, takeOverTrans);
+ void * res = m_operation->takeOverScanOp(NdbOperation::DeleteRequest,
+ takeOverTrans);
if(res == 0)
return -1;
return 0;
diff --git a/ndb/src/ndbapi/NdbSchemaCon.cpp b/ndb/src/ndbapi/NdbSchemaCon.cpp
index fbf30c70d12..88e90f9957f 100644
--- a/ndb/src/ndbapi/NdbSchemaCon.cpp
+++ b/ndb/src/ndbapi/NdbSchemaCon.cpp
@@ -14,28 +14,31 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
/*********************************************************************
-Name: NdbSchemaCon.C
+Name: NdbSchemaCon.cpp
Include:
Link:
Author: UABMNST Mona Natterkvist UAB/B/SD
EMIKRON Mikael Ronstrom
Date: 020826
-Version: 2.0
-Description: Interface between application and NDB
+Version: 3.0
+Description: Old Interface between application and NDB
Documentation:
Adjust: 980126 UABMNST First version.
020826 EMIKRON New version adapted to new DICT version
-************************************************************************************************/
+ 040524 Magnus Svensson - Adapted to not be included in public NdbApi
+ unless the user wants to use it.
+
+ NOTE: This file is only used as a compatibility layer for old test programs,
+ New programs should use NdbDictionary.hpp
+*********************************************************************/
+
#include "NdbSchemaCon.hpp"
#include "NdbSchemaOp.hpp"
#include "NdbApiSignal.hpp"
-#include "TransporterFacade.hpp"
-#include <RefConvert.hpp>
-#include <signaldata/CreateIndx.hpp>
-#include <signaldata/DropIndx.hpp>
-#include <signaldata/CreateTable.hpp>
-#include <NdbOut.hpp>
+
/*********************************************************************
NdbSchemaCon(Ndb* aNdb);
diff --git a/ndb/src/ndbapi/NdbSchemaOp.cpp b/ndb/src/ndbapi/NdbSchemaOp.cpp
index 9e495229661..aa2d0be311f 100644
--- a/ndb/src/ndbapi/NdbSchemaOp.cpp
+++ b/ndb/src/ndbapi/NdbSchemaOp.cpp
@@ -16,24 +16,31 @@
/*****************************************************************************
-Name: NdbSchemaOp.C
+Name: NdbSchemaOp.cpp
Include:
Link:
Author: UABMNST Mona Natterkvist UAB/B/SD
EMIKRON Mikael Ronstrom
-Date: 020826
-Version: 2.0
+Date: 040524
+Version: 3.0
Description: Interface between application and NDB
Documentation: Handles createTable and createAttribute calls
Adjust: 980125 UABMNST First version.
020826 EMIKRON New version for new DICT
+ 040524 Magnus Svensson - Adapted to not be included in public NdbApi
+ unless the user wants to use it.
+
+ NOTE: This file is only used as a compatibility layer for old test programs,
+ New programs should use NdbDictionary.hpp
*****************************************************************************/
#include <assert.h>
#include "NdbSchemaOp.hpp"
#include "NdbSchemaCon.hpp"
#include "API.hpp"
+
+
/*****************************************************************************
NdbSchemaOp(Ndb* aNdb, Table* aTable);
@@ -203,3 +210,11 @@ NdbSchemaOp::init(NdbSchemaCon* aSchemaCon)
theSchemaCon = aSchemaCon;
return 0;
}//NdbSchemaOp::init()
+
+
+const NdbError &
+NdbSchemaOp::getNdbError() const
+{
+ return theSchemaCon->getNdbError();
+}
+
diff --git a/ndb/src/ndbapi/NdbUtil.hpp b/ndb/src/ndbapi/NdbUtil.hpp
index 6a82af85987..80fc15ddd8c 100644
--- a/ndb/src/ndbapi/NdbUtil.hpp
+++ b/ndb/src/ndbapi/NdbUtil.hpp
@@ -30,7 +30,6 @@ Comment:
#define NdbUtil_H
#include <ndb_global.h>
-#include "AttrType.hpp"
class NdbApiSignal;
class NdbOperation;
diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp
index 696dfe68e40..2d722e12129 100644
--- a/ndb/src/ndbapi/Ndbif.cpp
+++ b/ndb/src/ndbapi/Ndbif.cpp
@@ -16,10 +16,9 @@
#include "NdbApiSignal.hpp"
-#include "AttrType.hpp"
#include "NdbImpl.hpp"
-#include "NdbSchemaOp.hpp"
-#include "NdbSchemaCon.hpp"
+//#include "NdbSchemaOp.hpp"
+//#include "NdbSchemaCon.hpp"
#include "NdbOperation.hpp"
#include "NdbIndexOperation.hpp"
#include "NdbScanReceiver.hpp"
@@ -42,13 +41,12 @@
/******************************************************************************
- * int init( int aNrOfCon, int aNrOfOp );
+ * int init( int aMaxNoOfTransactions );
*
* Return Value: Return 0 : init was successful.
* Return -1: In all other case.
- * Parameters: aNrOfCon : Number of connections offered to the application.
- * aNrOfOp : Number of operations offered to the application.
- * Remark: Create pointers and idle list Synchronous.
+ * Parameters: aMaxNoOfTransactions : Max number of simultaneous transations
+ * Remark: Create pointers and idle list Synchronous.
****************************************************************************/
int
Ndb::init(int aMaxNoOfTransactions)
@@ -254,8 +252,9 @@ Ndb::abortTransactionsAfterNodeFailure(Uint16 aNodeId)
for (int i = tNoSentTransactions - 1; i >= 0; i--) {
NdbConnection* localCon = theSentTransactionsArray[i];
if (localCon->getConnectedNodeId() == aNodeId ) {
- const SendStatusType sendStatus = localCon->theSendStatus;
- if (sendStatus == sendTC_OP || sendStatus == sendTC_COMMIT) {
+ const NdbConnection::SendStatusType sendStatus = localCon->theSendStatus;
+ if (sendStatus == NdbConnection::sendTC_OP ||
+ sendStatus == NdbConnection::sendTC_COMMIT) {
/*
A transaction was interrupted in the prepare phase by a node
failure. Since the transaction was not found in the phase
@@ -263,13 +262,13 @@ Ndb::abortTransactionsAfterNodeFailure(Uint16 aNodeId)
we report a normal node failure abort.
*/
localCon->setOperationErrorCodeAbort(4010);
- localCon->theCompletionStatus = CompletedFailure;
- } else if (sendStatus == sendTC_ROLLBACK) {
+ localCon->theCompletionStatus = NdbConnection::CompletedFailure;
+ } else if (sendStatus == NdbConnection::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 = CompletedSuccess;
+ localCon->theCompletionStatus = NdbConnection::CompletedSuccess;
} else {
#ifdef VM_TRACE
printState("abortTransactionsAfterNodeFailure %x", this);
@@ -281,7 +280,7 @@ 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->theCommitStatus = Aborted;
+ localCon->theCommitStatus = NdbConnection::Aborted;
localCon->theReleaseOnClose = true;
completedTransaction(localCon);
}//if
@@ -328,7 +327,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == sendTC_OP)) {
+ (tCon->theSendStatus == NdbConnection::sendTC_OP)) {
tReturnCode = tCon->receiveTCKEYCONF(keyConf, aSignal->getLength());
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -356,7 +355,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if (tCon->theSendStatus == sendTC_OP) {
+ if (tCon->theSendStatus == NdbConnection::sendTC_OP) {
tReturnCode = tOp->receiveREAD_CONF(tDataPtr,
aSignal->getLength());
if (tReturnCode != -1) {
@@ -381,7 +380,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if (tCon->theSendStatus == sendTC_OP) {
+ if (tCon->theSendStatus == NdbConnection::sendTC_OP) {
tReturnCode = tOp->receiveTRANSID_AI(tDataPtr,
aSignal->getLength());
if (tReturnCode != -1) {
@@ -398,7 +397,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if (tCon->theSendStatus == sendTC_OP) {
+ if (tCon->theSendStatus == NdbConnection::sendTC_OP) {
tReturnCode = tOp->receiveTRANSID_AI(tDataPtr,
aSignal->getLength());
if (tReturnCode != -1) {
@@ -442,8 +441,8 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if ((tCon->theSendStatus == sendTC_OP) ||
- (tCon->theSendStatus == sendTC_COMMIT)) {
+ if ((tCon->theSendStatus == NdbConnection::sendTC_OP) ||
+ (tCon->theSendStatus == NdbConnection::sendTC_COMMIT)) {
tReturnCode = tCon->receiveTCKEY_FAILCONF(failConf);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -469,8 +468,8 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if ((tCon->theSendStatus == sendTC_OP) ||
- (tCon->theSendStatus == sendTC_ROLLBACK)) {
+ if ((tCon->theSendStatus == NdbConnection::sendTC_OP) ||
+ (tCon->theSendStatus == NdbConnection::sendTC_ROLLBACK)) {
tReturnCode = tCon->receiveTCKEY_FAILREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -490,7 +489,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if (tCon->theSendStatus == sendTC_OP) {
+ if (tCon->theSendStatus == NdbConnection::sendTC_OP) {
tReturnCode = tOp->receiveTCKEYREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -512,7 +511,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == sendTC_COMMIT)) {
+ (tCon->theSendStatus == NdbConnection::sendTC_COMMIT)) {
tReturnCode = tCon->receiveTC_COMMITCONF(commitConf);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -537,7 +536,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == sendTC_COMMIT)) {
+ (tCon->theSendStatus == NdbConnection::sendTC_COMMIT)) {
tReturnCode = tCon->receiveTC_COMMITREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -553,7 +552,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == sendTC_ROLLBACK)) {
+ (tCon->theSendStatus == NdbConnection::sendTC_ROLLBACK)) {
tReturnCode = tCon->receiveTCROLLBACKCONF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -568,7 +567,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == sendTC_ROLLBACK)) {
+ (tCon->theSendStatus == NdbConnection::sendTC_ROLLBACK)) {
tReturnCode = tCon->receiveTCROLLBACKREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -789,7 +788,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
const BlockReference aTCRef = aSignal->theSendersBlockRef;
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == sendTC_OP)) {
+ (tCon->theSendStatus == NdbConnection::sendTC_OP)) {
tReturnCode = tCon->receiveTCINDXCONF(indxConf, aSignal->getLength());
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -812,7 +811,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tIndexOp->checkMagicNumber() == 0) {
tCon = tIndexOp->theNdbCon;
if (tCon != NULL) {
- if (tCon->theSendStatus == sendTC_OP) {
+ if (tCon->theSendStatus == NdbConnection::sendTC_OP) {
tReturnCode = tIndexOp->receiveTCINDXREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -866,7 +865,8 @@ Ndb::completedTransaction(NdbConnection* aCon)
Uint32 tTransArrayIndex = aCon->theTransArrayIndex;
Uint32 tNoSentTransactions = theNoOfSentTransactions;
Uint32 tNoCompletedTransactions = theNoOfCompletedTransactions;
- if ((tNoSentTransactions > 0) && (aCon->theListState == InSendList) &&
+ if ((tNoSentTransactions > 0) &&
+ (aCon->theListState == NdbConnection::InSendList) &&
(tTransArrayIndex < tNoSentTransactions)) {
NdbConnection* tMoveCon = theSentTransactionsArray[tNoSentTransactions - 1];
@@ -880,7 +880,7 @@ Ndb::completedTransaction(NdbConnection* aCon)
theNoOfCompletedTransactions = tNoCompletedTransactions + 1;
theNoOfSentTransactions = tNoSentTransactions - 1;
- aCon->theListState = InCompletedList;
+ aCon->theListState = NdbConnection::InCompletedList;
aCon->handleExecuteCompletion();
if ((theMinNoOfEventsToWakeUp != 0) &&
(theNoOfCompletedTransactions >= theMinNoOfEventsToWakeUp)) {
@@ -915,7 +915,7 @@ Ndb::reportCallback(NdbConnection** aCopyArray, Uint32 aNoOfCompletedTrans)
NdbAsynchCallback aCallback = aCopyArray[i]->theCallbackFunction;
int tResult = 0;
if (aCallback != NULL) {
- if (aCopyArray[i]->theReturnStatus == ReturnFailure) {
+ if (aCopyArray[i]->theReturnStatus == NdbConnection::ReturnFailure) {
tResult = -1;
}//if
(*aCallback)(tResult, aCopyArray[i], anyObject);
@@ -939,13 +939,13 @@ Ndb::pollCompleted(NdbConnection** aCopyArray)
if (tNoCompletedTransactions > 0) {
for (i = 0; i < tNoCompletedTransactions; i++) {
aCopyArray[i] = theCompletedTransactionsArray[i];
- if (aCopyArray[i]->theListState != InCompletedList) {
+ if (aCopyArray[i]->theListState != NdbConnection::InCompletedList) {
ndbout << "pollCompleted error ";
ndbout << aCopyArray[i]->theListState << endl;
abort();
}//if
theCompletedTransactionsArray[i] = NULL;
- aCopyArray[i]->theListState = NotInList;
+ aCopyArray[i]->theListState = NdbConnection::NotInList;
}//for
}//if
theNoOfCompletedTransactions = 0;
@@ -967,8 +967,8 @@ Ndb::check_send_timeout()
a_con->printState();
#endif
a_con->setOperationErrorCodeAbort(4012);
- a_con->theCommitStatus = Aborted;
- a_con->theCompletionStatus = CompletedFailure;
+ a_con->theCommitStatus = NdbConnection::Aborted;
+ a_con->theCompletionStatus = NdbConnection::CompletedFailure;
a_con->handleExecuteCompletion();
remove_sent_list(i);
insert_completed_list(a_con);
@@ -997,7 +997,7 @@ Ndb::insert_completed_list(NdbConnection* a_con)
Uint32 no_of_comp = theNoOfCompletedTransactions;
theCompletedTransactionsArray[no_of_comp] = a_con;
theNoOfCompletedTransactions = no_of_comp + 1;
- a_con->theListState = InCompletedList;
+ a_con->theListState = NdbConnection::InCompletedList;
a_con->theTransArrayIndex = no_of_comp;
return no_of_comp;
}
@@ -1008,7 +1008,7 @@ Ndb::insert_sent_list(NdbConnection* a_con)
Uint32 no_of_sent = theNoOfSentTransactions;
theSentTransactionsArray[no_of_sent] = a_con;
theNoOfSentTransactions = no_of_sent + 1;
- a_con->theListState = InSendList;
+ a_con->theListState = NdbConnection::InSendList;
a_con->theTransArrayIndex = no_of_sent;
return no_of_sent;
}
@@ -1046,10 +1046,10 @@ Ndb::sendPrepTrans(int forceSend)
if ((tp->getNodeSequence(node_id) == a_con->theNodeSequence) &&
tp->get_node_alive(node_id) ||
(tp->get_node_stopping(node_id) &&
- ((a_con->theSendStatus == sendABORT) ||
- (a_con->theSendStatus == sendABORTfail) ||
- (a_con->theSendStatus == sendCOMMITstate) ||
- (a_con->theSendStatus == sendCompleted)))) {
+ ((a_con->theSendStatus == NdbConnection::sendABORT) ||
+ (a_con->theSendStatus == NdbConnection::sendABORTfail) ||
+ (a_con->theSendStatus == NdbConnection::sendCOMMITstate) ||
+ (a_con->theSendStatus == NdbConnection::sendCompleted)))) {
/*
We will send if
1) Node is alive and sequences are correct OR
@@ -1081,13 +1081,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 == sendOperations) {
+ if (a_con->theSendStatus == NdbConnection::sendOperations) {
a_con->setOperationErrorCodeAbort(4021);
- a_con->theCommitStatus = NeedAbort;
+ a_con->theCommitStatus = NdbConnection::NeedAbort;
TRACE_DEBUG("Send buffer full and sendOperations");
} else {
a_con->setOperationErrorCodeAbort(4026);
- a_con->theCommitStatus = Aborted;
+ a_con->theCommitStatus = NdbConnection::Aborted;
TRACE_DEBUG("Send buffer full, set state to Aborted");
}//if
}//if
@@ -1104,7 +1104,7 @@ Ndb::sendPrepTrans(int forceSend)
*/
TRACE_DEBUG("Abort a transaction when stopping a node");
a_con->setOperationErrorCodeAbort(4023);
- a_con->theCommitStatus = NeedAbort;
+ a_con->theCommitStatus = NdbConnection::NeedAbort;
} else {
/*
The node is hard dead and we cannot continue. We will also release
@@ -1114,10 +1114,10 @@ Ndb::sendPrepTrans(int forceSend)
a_con->setOperationErrorCodeAbort(4025);
a_con->theReleaseOnClose = true;
a_con->theTransactionIsStarted = false;
- a_con->theCommitStatus = Aborted;
+ a_con->theCommitStatus = NdbConnection::Aborted;
}//if
}//if
- a_con->theCompletionStatus = CompletedFailure;
+ a_con->theCompletionStatus = NdbConnection::CompletedFailure;
a_con->handleExecuteCompletion();
insert_completed_list(a_con);
}//for
diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp
index be7acc48d7a..042faa431a0 100644
--- a/ndb/src/ndbapi/Ndbinit.cpp
+++ b/ndb/src/ndbapi/Ndbinit.cpp
@@ -17,8 +17,8 @@
#include "NdbApiSignal.hpp"
#include "NdbImpl.hpp"
-#include "NdbSchemaOp.hpp"
-#include "NdbSchemaCon.hpp"
+//#include "NdbSchemaOp.hpp"
+//#include "NdbSchemaCon.hpp"
#include "NdbOperation.hpp"
#include "NdbConnection.hpp"
#include "NdbRecAttr.hpp"
@@ -72,8 +72,8 @@ Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) :
theOpIdleList(NULL),
theScanOpIdleList(NULL),
theIndexOpIdleList(NULL),
- theSchemaConIdleList(NULL),
- theSchemaConToNdbList(NULL),
+// theSchemaConIdleList(NULL),
+// theSchemaConToNdbList(NULL),
theTransactionList(NULL),
theConnectionArray(NULL),
theRecAttrIdleList(NULL),
@@ -207,8 +207,8 @@ Ndb::~Ndb()
NdbMutex_Unlock(&createNdbMutex);
- if (theSchemaConToNdbList != NULL)
- closeSchemaTransaction(theSchemaConToNdbList);
+// if (theSchemaConToNdbList != NULL)
+// closeSchemaTransaction(theSchemaConToNdbList);
while ( theConIdleList != NULL )
freeNdbCon();
while ( theSignalIdleList != NULL )
diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp
index 3839cc3291b..0d9c0f60985 100644
--- a/ndb/src/ndbapi/Ndblist.cpp
+++ b/ndb/src/ndbapi/Ndblist.cpp
@@ -16,8 +16,8 @@
#include <NdbOut.hpp>
#include "Ndb.hpp"
-#include "NdbSchemaOp.hpp"
-#include "NdbSchemaCon.hpp"
+//#include "NdbSchemaOp.hpp"
+//#include "NdbSchemaCon.hpp"
#include "NdbOperation.hpp"
#include "NdbScanOperation.hpp"
#include "NdbIndexOperation.hpp"
@@ -104,7 +104,7 @@ Ndb::createConIdleList(int aNrOfCon)
tNdbCon->next(theConIdleList);
theConIdleList = tNdbCon;
}
- tNdbCon->Status(NotConnected);
+ tNdbCon->Status(NdbConnection::NotConnected);
}
theNoOfAllocatedTransactions = aNrOfCon;
return aNrOfCon;
@@ -770,7 +770,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(DisConnecting);
+ a_con->Status(NdbConnection::DisConnecting);
a_con->theMagicNumber = 0x37412619;
int ret_code = sendRecSignal(node_id,
WAIT_TC_RELEASE,
diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp
index f4a3ae3e87d..7806e482f1f 100644
--- a/ndb/src/ndbapi/TransporterFacade.cpp
+++ b/ndb/src/ndbapi/TransporterFacade.cpp
@@ -16,7 +16,6 @@
#include <ndb_global.h>
#include <ndb_limits.h>
-#include <AttrType.hpp>
#include "TransporterFacade.hpp"
#include "ClusterMgr.hpp"
#include <IPCConfig.hpp>
diff --git a/ndb/src/ndbapi/TransporterFacade.hpp b/ndb/src/ndbapi/TransporterFacade.hpp
index d9d2dbbcf0f..1fe72debe1c 100644
--- a/ndb/src/ndbapi/TransporterFacade.hpp
+++ b/ndb/src/ndbapi/TransporterFacade.hpp
@@ -17,7 +17,6 @@
#ifndef TransporterFacade_H
#define TransporterFacade_H
-#include <AttrType.hpp>
#include <kernel_types.h>
#include <ndb_limits.h>
#include <NdbThread.h>
@@ -43,6 +42,10 @@ extern "C" {
void atexit_stop_instance();
}
+/**
+ * Max number of Ndb objects in different threads.
+ * (Ndb objects should not be shared by different threads.)
+ */
class TransporterFacade
{
public:
@@ -156,6 +159,8 @@ private:
/**
* Block number handling
*/
+ static const unsigned MAX_NO_THREADS = 4711;
+
struct ThreadData {
static const Uint32 ACTIVE = (1 << 16) | 1;
static const Uint32 INACTIVE = (1 << 16);