Commit 356d343c authored by unknown's avatar unknown

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
parent fde8d07d
......@@ -9,8 +9,7 @@ ndbapiinclude_HEADERS = \
ndbapi/ndbapi_limits.h \
ndbapi/Ndb.hpp \
ndbapi/NdbApi.hpp \
ndbapi/NdbConnection.hpp \
ndbapi/NdbCursorOperation.hpp \
ndbapi/NdbTransaction.hpp \
ndbapi/NdbDictionary.hpp \
ndbapi/NdbError.hpp \
ndbapi/NdbEventOperation.hpp \
......
......@@ -33,7 +33,7 @@ class ScanTabReq {
/**
* Sender(s)
*/
friend class NdbConnection;
friend class NdbTransaction;
friend class NdbScanOperation;
friend class NdbIndexScanOperation;
......@@ -277,7 +277,7 @@ class ScanTabConf {
/**
* Reciver(s)
*/
friend class NdbConnection; // Reciver
friend class NdbTransaction; // Reciver
/**
* Sender(s)
......@@ -345,7 +345,7 @@ class ScanTabRef {
/**
* Reciver(s)
*/
friend class NdbConnection; // Reciver
friend class NdbTransaction; // Reciver
/**
* Sender(s)
......
......@@ -33,7 +33,7 @@ class TcCommitConf {
* Reciver(s)
*/
friend class Ndb;
friend class NdbConnection;
friend class NdbTransaction;
public:
STATIC_CONST( SignalLength = 3 );
......@@ -60,7 +60,7 @@ class TcCommitRef {
/**
* Reciver(s)
*/
friend class NdbConnection;
friend class NdbTransaction;
public:
STATIC_CONST( SignalLength = 4 );
......
......@@ -36,7 +36,7 @@ class TcHbRep {
/**
* Sender(s)
*/
friend class NdbConnection;
friend class NdbTransaction;
/**
* For printing
......
......@@ -26,7 +26,7 @@ class TcIndxConf {
* Reciver(s)
*/
friend class Ndb;
friend class NdbConnection;
friend class NdbTransaction;
/**
* Sender(s)
......
......@@ -27,7 +27,7 @@ class TcKeyConf {
* Reciver(s)
*/
friend class Ndb;
friend class NdbConnection;
friend class NdbTransaction;
friend class Ndbcntr;
friend class DbUtil;
......
......@@ -33,7 +33,7 @@ class TcKeyFailConf {
* Reciver(s)
*/
friend class Ndb;
friend class NdbConnection;
friend class NdbTransaction;
public:
STATIC_CONST( SignalLength = 3 );
......
......@@ -23,7 +23,7 @@ class TcRollbackRep {
/**
* Sender(s)
*/
friend class NdbConnection;
friend class NdbTransaction;
friend class DbUtil;
/**
......
......@@ -28,7 +28,7 @@ class TransIdAI {
/**
* Receiver(s)
*/
friend class NdbConnection;
friend class NdbTransaction;
friend class Dbtc;
friend class Dbutil;
friend class Dblqh;
......
......@@ -362,22 +362,6 @@ extern "C" {
*/
NdbMgmHandle ndb_mgm_create_handle();
/**
* Set connecst string to management server
*
* @param handle Management handle
* @param connect_string Connect string to the management server,
*
* @return -1 on error.
*/
int ndb_mgm_set_connectstring(NdbMgmHandle handle,
const char *connect_string);
int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle);
int ndb_mgm_get_connected_port(NdbMgmHandle handle);
const char *ndb_mgm_get_connected_host(NdbMgmHandle handle);
const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz);
/**
* Destroy a management server handle
*
......@@ -391,6 +375,29 @@ extern "C" {
* @{
*/
/**
* Set connect string to management server
*
* @param handle Management handle
* @param connect_string Connect string to the management server,
*
* @return -1 on error.
*/
int ndb_mgm_set_connectstring(NdbMgmHandle handle,
const char *connect_string);
/**
* Get connectstring used for connection
*
* @note returns what the connectstring defaults to if the above call has
* not been performed
*
* @param handle Management handle
*
* @return connectstring
*/
const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz);
/**
* Connect to a management server
*
......@@ -408,6 +415,33 @@ extern "C" {
*/
int ndb_mgm_disconnect(NdbMgmHandle handle);
/**
* Get nodeid used in the connection
*
* @param handle Management handle
*
* @return node id
*/
int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle);
/**
* Get port used in the connection
*
* @param handle Management handle
*
* @return port
*/
int ndb_mgm_get_connected_port(NdbMgmHandle handle);
/**
* Get host used in the connection
*
* @param handle Management handle
*
* @return hostname
*/
const char *ndb_mgm_get_connected_host(NdbMgmHandle handle);
/** @} *********************************************************************/
/**
* @name Functions: Convert between different data formats
......@@ -436,7 +470,8 @@ extern "C" {
* @param type Node type.
* @return NULL if invalid id.
*/
const char * ndb_mgm_get_node_type_alias_string(enum ndb_mgm_node_type type, const char **str);
const char * ndb_mgm_get_node_type_alias_string(enum ndb_mgm_node_type type,
const char **str);
/**
* Convert a string to a ndb_mgm_node_status
......@@ -454,8 +489,10 @@ extern "C" {
*/
const char * ndb_mgm_get_node_status_string(enum ndb_mgm_node_status status);
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
ndb_mgm_event_category ndb_mgm_match_event_category(const char *);
const char * ndb_mgm_get_event_category_string(enum ndb_mgm_event_category);
#endif
/** @} *********************************************************************/
/**
......@@ -469,6 +506,7 @@ extern "C" {
* Note the caller must free the pointer returned.
*
* @param handle Management handle.
*
* @return Cluster state (or NULL on error).
*/
struct ndb_mgm_cluster_state * ndb_mgm_get_status(NdbMgmHandle handle);
......@@ -488,6 +526,7 @@ extern "C" {
* n - Means stop n node(s) specified in the
* array node_list
* @param node_list List of node ids of database nodes to be stopped
*
* @return No of nodes stopped (or -1 on error)
*
* @note The function is equivalent
......@@ -507,6 +546,7 @@ extern "C" {
* @param node_list List of node ids of database nodes to be stopped
* @param abort Don't perform gracefull stop,
* but rather stop immediatly
*
* @return No of nodes stopped (or -1 on error).
*/
int ndb_mgm_stop2(NdbMgmHandle handle, int no_of_nodes,
......@@ -521,6 +561,7 @@ extern "C" {
* n - Means stop n node(s) specified in the
* array node_list
* @param node_list List of node ids of database nodes to be stopped
*
* @return No of nodes stopped (or -1 on error).
*
* @note The function is equivalent to
......@@ -543,6 +584,7 @@ extern "C" {
* waiting for start command
* @param abort Don't perform gracefull restart,
* but rather restart immediatly
*
* @return No of nodes stopped (or -1 on error).
*/
int ndb_mgm_restart2(NdbMgmHandle handle, int no_of_nodes,
......@@ -558,6 +600,7 @@ extern "C" {
* n - Means start n node(s) specified in
* the array node_list
* @param node_list List of node ids of database nodes to be started
*
* @return No of nodes started (or -1 on error).
*
* @note The nodes to start must have been started with nostart(-n)
......@@ -582,6 +625,7 @@ extern "C" {
* @param handle NDB management handle.
* @param level A cluster log level to filter.
* @param reply Reply message.
*
* @return -1 on error.
*/
int ndb_mgm_filter_clusterlog(NdbMgmHandle handle,
......@@ -592,6 +636,7 @@ extern "C" {
* Get log filter
*
* @param handle NDB management handle
*
* @return A vector of seven elements,
* where each element contains
* 1 if a severity is enabled and 0 if not.
......@@ -620,7 +665,7 @@ extern "C" {
enum ndb_mgm_event_category category,
int level,
struct ndb_mgm_reply* reply);
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/**
* Set log category and levels for the Node
*
......@@ -646,6 +691,7 @@ extern "C" {
*/
int ndb_mgm_get_stat_port(NdbMgmHandle handle,
struct ndb_mgm_reply* reply);
#endif
/** @} *********************************************************************/
/**
......@@ -699,6 +745,7 @@ extern "C" {
* @param handle NDB management handle.
* @param nodeId Node Id of the single user node
* @param reply Reply message.
*
* @return -1 on error.
*/
int ndb_mgm_exit_single_user(NdbMgmHandle handle,
......@@ -709,6 +756,7 @@ extern "C" {
*
* @param filter pairs of { level, category } that will be
* pushed to fd, level=0 ends lists
*
* @return fd which events will be pushed to
*/
int ndb_mgm_listen_event(NdbMgmHandle handle, int filter[]);
......@@ -718,12 +766,16 @@ extern "C" {
* @param handle NDB management handle.
* @param version Version of configuration, 0 means latest
* @see MAKE_VERSION
* @Note the caller must call ndb_mgm_detroy_configuration
*
* @return configuration
*
* @note the caller must call ndb_mgm_detroy_configuration
*/
struct ndb_mgm_configuration * ndb_mgm_get_configuration(NdbMgmHandle handle,
unsigned version);
void ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *);
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
int ndb_mgm_alloc_nodeid(NdbMgmHandle handle,
unsigned version, int nodetype);
/**
......@@ -749,6 +801,8 @@ extern "C" {
int param, const char ** value);
int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **);
int ndb_mgm_check_connection(NdbMgmHandle handle);
#endif
#ifdef __cplusplus
}
#endif
......
This diff is collapsed.
......@@ -19,7 +19,7 @@
#include "ndbapi_limits.h"
#include "Ndb.hpp"
#include "NdbConnection.hpp"
#include "NdbTransaction.hpp"
#include "NdbOperation.hpp"
#include "NdbScanOperation.hpp"
#include "NdbIndexOperation.hpp"
......
......@@ -19,11 +19,11 @@
#include <ndb_types.h>
#include <NdbDictionary.hpp>
#include <NdbConnection.hpp>
#include <NdbTransaction.hpp>
#include <NdbError.hpp>
class Ndb;
class NdbConnection;
class NdbTransaction;
class NdbOperation;
class NdbRecAttr;
class NdbTableImpl;
......@@ -67,7 +67,7 @@ class NdbColumnImpl;
* cases NdbBlob is forced to do implicit executes. To avoid this,
* operate on complete blob parts.
*
* Use NdbConnection::executePendingBlobOps to flush your reads and
* Use NdbTransaction::executePendingBlobOps to flush your reads and
* writes. It avoids execute penalty if nothing is pending. It is not
* needed after execute (obviously) or after next scan result.
*
......@@ -212,12 +212,14 @@ public:
NdbBlob* blobsNextBlob();
private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class Ndb;
friend class NdbConnection;
friend class NdbTransaction;
friend class NdbOperation;
friend class NdbScanOperation;
friend class NdbDictionaryImpl;
friend class NdbResultSet; // atNextResult
#endif
// state
State theState;
void setState(State newState);
......@@ -226,7 +228,7 @@ private:
static void getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnImpl* c);
// ndb api stuff
Ndb* theNdb;
NdbConnection* theNdbCon;
NdbTransaction* theNdbCon;
NdbOperation* theNdbOp;
const NdbTableImpl* theTable;
const NdbTableImpl* theAccessTable;
......@@ -316,7 +318,7 @@ private:
// callbacks
int invokeActiveHook();
// blob handle maintenance
int atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* aColumn);
int atPrepare(NdbTransaction* aCon, NdbOperation* anOp, const NdbColumnImpl* aColumn);
int preExecute(ExecType anExecType, bool& batch);
int postExecute(ExecType anExecType);
int preCommit();
......@@ -324,7 +326,7 @@ private:
// errors
void setErrorCode(int anErrorCode, bool invalidFlag = true);
void setErrorCode(NdbOperation* anOp, bool invalidFlag = true);
void setErrorCode(NdbConnection* aCon, bool invalidFlag = true);
void setErrorCode(NdbTransaction* aCon, bool invalidFlag = true);
#ifdef VM_TRACE
int getOperationType() const;
friend class NdbOut& operator<<(NdbOut&, const NdbBlob&);
......
/* 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 */
#ifndef NdbCursorOperation_H
#define NdbCursorOperation_H
#endif
......@@ -388,8 +388,10 @@ public:
#endif
private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbRecAttr;
friend class NdbColumnImpl;
#endif
class NdbColumnImpl & m_impl;
Column(NdbColumnImpl&);
Column& operator=(const Column&);
......@@ -646,7 +648,9 @@ public:
#endif
private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbTableImpl;
#endif
class NdbTableImpl & m_impl;
Table(NdbTableImpl&);
};
......@@ -798,8 +802,9 @@ public:
virtual int getObjectVersion() const;
private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbIndexImpl;
#endif
class NdbIndexImpl & m_impl;
Index(NdbIndexImpl&);
};
......@@ -851,8 +856,10 @@ public:
void print();
private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbEventImpl;
friend class NdbEventOperationImpl;
#endif
class NdbEventImpl & m_impl;
Event(NdbEventImpl&);
};
......@@ -1071,9 +1078,11 @@ public:
~Dictionary();
private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbDictionaryImpl;
friend class UtilTransactions;
friend class NdbBlob;
#endif
class NdbDictionaryImpl & m_impl;
Dictionary(NdbDictionaryImpl&);
const Table * getIndexTable(const char * indexName,
......
......@@ -203,8 +203,10 @@ public:
void print();
private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbEventOperationImpl;
friend class Ndb;
#endif
NdbEventOperation(Ndb *theNdb, const char* eventName,int bufferLength);
~NdbEventOperation();
static int wait(void *p, int aMillisecondNumber);
......
......@@ -14,18 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*****************************************************************************
* Name: NdbIndexOperation.hpp
* Include:
* Link:
* Author: Martin Sköld
* Date: 2002-04-01
* Version: 0.1
* Description: Secondary index support
* Documentation:
* Adjust: 2002-04-01 Martin Sköld First version.
****************************************************************************/
#ifndef NdbIndexOperation_H
#define NdbIndexOperation_H
......@@ -40,8 +28,10 @@ class NdbResultSet;
*/
class NdbIndexOperation : public NdbOperation
{
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class Ndb;
friend class NdbConnection;
friend class NdbTransaction;
#endif
public:
/**
......@@ -54,16 +44,17 @@ public:
/**
* Define the NdbIndexOperation to be a standard operation of type readTuple.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* reads a tuple.
*
* @return 0 if successful otherwise -1.
*/
int readTuple(LockMode);
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/**
* Define the NdbIndexOperation to be a standard operation of type readTuple.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* reads a tuple.
*
* @return 0 if successful otherwise -1.
......@@ -73,7 +64,7 @@ public:
/**
* Define the NdbIndexOperation to be a standard operation of type
* readTupleExclusive.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* read a tuple using an exclusive lock.
*
* @return 0 if successful otherwise -1.
......@@ -82,7 +73,7 @@ public:
/**
* Define the NdbIndexOperation to be a standard operation of type simpleRead.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* reads an existing tuple (using shared read lock),
* but releases lock immediately after read.
*
......@@ -101,7 +92,7 @@ public:
/**
* Define the NdbOperation to be a standard operation of type committedRead.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* read latest committed value of the record.
*
* This means that if another transaction is updating the
......@@ -113,7 +104,6 @@ public:
*/
int dirtyRead();
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
int committedRead();
#endif
......@@ -121,7 +111,7 @@ public:
* Define the NdbIndexOperation to be a standard operation of type
* updateTuple.
*
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* updates a tuple in the table.
*
* @return 0 if successful otherwise -1.
......@@ -132,7 +122,7 @@ public:
* Define the NdbIndexOperation to be a standard operation of type
* deleteTuple.
*
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* deletes a tuple.
*
* @return 0 if successful otherwise -1.
......@@ -143,7 +133,7 @@ public:
* Define the NdbIndexOperation to be a standard operation of type
* dirtyUpdate.
*
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* updates without two-phase commit.
*
* @return 0 if successful otherwise -1.
......@@ -181,7 +171,7 @@ private:
// Overloaded methods from NdbCursorOperation
int indxInit(const class NdbIndexImpl* anIndex,
const class NdbTableImpl* aTable,
NdbConnection* myConnection);
NdbTransaction*);
int prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId);
......
......@@ -24,11 +24,14 @@
* @brief Class of scan operations for use to scan ordered index
*/
class NdbIndexScanOperation : public NdbScanOperation {
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class Ndb;
friend class NdbConnection;
friend class NdbTransaction;
friend class NdbResultSet;
friend class NdbOperation;
friend class NdbScanOperation;
#endif
public:
/**
* readTuples returns a NdbResultSet where tuples are stored.
......@@ -50,6 +53,7 @@ public:
bool order_desc = false,
bool read_range_no = false);
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
inline int readTuples(int parallell){
return readTuples(LM_Read, 0, parallell, false);
}
......@@ -57,6 +61,7 @@ public:
inline int readTuplesExclusive(int parallell = 0){
return readTuples(LM_Exclusive, 0, parallell, false);
}
#endif
/**
* Type of ordered index key bound. The values (0-4) will not change
......
......@@ -27,7 +27,7 @@ class Ndb;
class NdbApiSignal;
class NdbRecAttr;
class NdbOperation;
class NdbConnection;
class NdbTransaction;
class NdbColumnImpl;
class NdbBlob;
......@@ -37,14 +37,17 @@ class NdbBlob;
*/
class NdbOperation
{
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class Ndb;
friend class NdbConnection;
friend class NdbTransaction;
friend class NdbScanOperation;
friend class NdbScanReceiver;
friend class NdbScanFilter;
friend class NdbScanFilterImpl;
friend class NdbReceiver;
friend class NdbBlob;
#endif
public:
/**
* @name Define Standard Operation Type
......@@ -66,7 +69,7 @@ public:
/**
* Define the NdbOperation to be a standard operation of type insertTuple.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* adds a new tuple to the table.
*
* @return 0 if successful otherwise -1.
......@@ -75,7 +78,7 @@ public:
/**
* Define the NdbOperation to be a standard operation of type updateTuple.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* updates a tuple in the table.
*
* @return 0 if successful otherwise -1.
......@@ -84,7 +87,7 @@ public:
/**
* Define the NdbOperation to be a standard operation of type writeTuple.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* writes a tuple to the table.
* If the tuple exists, it updates it, otherwise an insert takes place.
*
......@@ -94,7 +97,7 @@ public:
/**
* Define the NdbOperation to be a standard operation of type deleteTuple.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* delete a tuple.
*
* @return 0 if successful otherwise -1.
......@@ -103,7 +106,7 @@ public:
/**
* Define the NdbOperation to be a standard operation of type readTuple.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* reads a tuple.
*
* @return 0 if successful otherwise -1.
......@@ -112,17 +115,18 @@ public:
/**
* Define the NdbOperation to be a standard operation of type readTuple.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* reads a tuple.
*
* @return 0 if successful otherwise -1.
*/
virtual int readTuple();
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/**
* Define the NdbOperation to be a standard operation of type
* readTupleExclusive.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* read a tuple using an exclusive lock.
*
* @return 0 if successful otherwise -1.
......@@ -132,7 +136,7 @@ public:
/**
* Define the NdbOperation to be a standard operation of type
* simpleRead.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* reads an existing tuple (using shared read lock),
* but releases lock immediately after read.
*
......@@ -149,10 +153,9 @@ public:
*/
virtual int simpleRead();
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/**
* Define the NdbOperation to be a standard operation of type committedRead.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* read latest committed value of the record.
*
* This means that if another transaction is updating the
......@@ -169,7 +172,7 @@ public:
/**
* Define the NdbOperation to be a standard operation of type committedRead.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* read latest committed value of the record.
*
* This means that if another transaction is updating the
......@@ -183,7 +186,7 @@ public:
/**
* Define the NdbOperation to be a standard operation of type dirtyUpdate.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* updates without two-phase commit.
*
* @return 0 if successful otherwise -1.
......@@ -192,7 +195,7 @@ public:
/**
* Define the NdbOperation to be a standard operation of type dirtyWrite.
* When calling NdbConnection::execute, this operation
* When calling NdbTransaction::execute, this operation
* writes without two-phase commit.
*
* @return 0 if successful otherwise -1.
......@@ -301,7 +304,7 @@ public:
* @note This method does not fetch the attribute value from
* the database! The NdbRecAttr object returned by this method
* is <em>not</em> readable/printable before the
* transaction has been executed with NdbConnection::execute.
* transaction has been executed with NdbTransaction::execute.
*
* @param anAttrName Attribute name
* @param aValue If this is non-NULL, then the attribute value
......@@ -743,7 +746,7 @@ protected:
//--------------------------------------------------------------
// Initialise after allocating operation to a transaction
//--------------------------------------------------------------
int init(const class NdbTableImpl*, NdbConnection* aCon);
int init(const class NdbTableImpl*, NdbTransaction* aCon);
void initInterpreter();
void next(NdbOperation*); // Set next pointer
......@@ -775,7 +778,7 @@ protected:
void Status(OperationStatus); // Set the status information
void NdbCon(NdbConnection*); // Set reference to connection
void NdbCon(NdbTransaction*); // Set reference to connection
// object.
virtual void release(); // Release all operations
......@@ -812,7 +815,7 @@ protected:
virtual int equal_impl(const NdbColumnImpl*,const char* aValue, Uint32 len);
virtual NdbRecAttr* getValue_impl(const NdbColumnImpl*, char* aValue = 0);
int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len);
NdbBlob* getBlobHandle(NdbConnection* aCon, const NdbColumnImpl* anAttrObject);
NdbBlob* getBlobHandle(NdbTransaction* aCon, const NdbColumnImpl* anAttrObject);
int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue);
int subValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
......@@ -861,7 +864,7 @@ protected:
int theErrorLine; // Error line
Ndb* theNdb; // Point back to the Ndb object.
NdbConnection* theNdbCon; // Point back to the connection object.
NdbTransaction* theNdbCon; // Point back to the connection object.
NdbOperation* theNext; // Next pointer to operation.
union {
......@@ -1043,14 +1046,14 @@ NdbOperation::Status( OperationStatus aStatus )
}
/******************************************************************************
void NdbCon(NdbConnection* aNdbCon);
void NdbCon(NdbTransaction* aNdbCon);
Parameters: aNdbCon: Pointers to NdbConnection object.
Parameters: aNdbCon: Pointers to NdbTransaction object.
Remark: Set the reference to the connection in the operation object.
******************************************************************************/
inline
void
NdbOperation::NdbCon(NdbConnection* aNdbCon)
NdbOperation::NdbCon(NdbTransaction* aNdbCon)
{
theNdbCon = aNdbCon;
}
......
......@@ -34,7 +34,7 @@ class NdbOperation;
* MyRecAttr = MyOperation->getValue("ATTR2", NULL);
* if (MyRecAttr == NULL) goto error;
*
* if (MyConnection->execute(Commit) == -1) goto error;
* if (MyTransaction->execute(Commit) == -1) goto error;
*
* ndbout << MyRecAttr->u_32_value();
* @endcode
......@@ -43,14 +43,14 @@ class NdbOperation;
* @ref ndbapi_example2.cpp.
*
* @note The NdbRecAttr object is instantiated with its value when
* NdbConnection::execute is called. Before this, the value is
* NdbTransaction::execute is called. Before this, the value is
* undefined. (NdbRecAttr::isNULL can be used to check
* if the value is defined or not.)
* This means that an NdbRecAttr object only has valid information
* between the time of calling NdbConnection::execute and
* between the time of calling NdbTransaction::execute and
* the time of Ndb::closeTransaction.
* The value of the null indicator is -1 until the
* NdbConnection::execute method have been called.
* NdbTransaction::execute method have been called.
*
* For simple types, there are methods which directly getting the value
* from the NdbRecAttr object.
......@@ -72,12 +72,14 @@ class NdbOperation;
*/
class NdbRecAttr
{
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbOperation;
friend class NdbIndexScanOperation;
friend class NdbEventOperationImpl;
friend class NdbReceiver;
friend class Ndb;
friend class NdbOut& operator<<(class NdbOut&, const class AttributeS&);
#endif
public:
/**
......@@ -124,7 +126,7 @@ public:
* Check if attribute value is NULL.
*
* @return -1 = Not defined (Failure or
* NdbConnection::execute not yet called).<br>
* NdbTransaction::execute not yet called).<br>
* 0 = Attribute value is defined, but not equal to NULL.<br>
* 1 = Attribute value is defined and equal to NULL.
*/
......
......@@ -22,16 +22,18 @@
#include <ndb_global.h>
class Ndb;
class NdbConnection;
class NdbTransaction;
class NdbReceiver
{
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class Ndb;
friend class NdbOperation;
friend class NdbScanOperation;
friend class NdbIndexOperation;
friend class NdbIndexScanOperation;
friend class NdbConnection;
friend class NdbTransaction;
#endif
public:
enum ReceiverType { NDB_UNINITIALIZED,
NDB_OPERATION = 1,
......@@ -52,7 +54,7 @@ public:
return m_type;
}
inline NdbConnection * getTransaction();
inline NdbTransaction * getTransaction();
void* getOwner(){
return m_owner;
}
......
......@@ -169,7 +169,9 @@ public:
/** @} *********************************************************************/
private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbScanFilterImpl;
#endif
class NdbScanFilterImpl & m_impl;
NdbScanFilter& operator=(const NdbScanFilter&); ///< Defined not implemented
};
......
......@@ -39,11 +39,14 @@ class NdbResultSet;
* @brief Class of scan operations for use in transactions.
*/
class NdbScanOperation : public NdbOperation {
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class Ndb;
friend class NdbConnection;
friend class NdbTransaction;
friend class NdbResultSet;
friend class NdbOperation;
friend class NdbBlob;
#endif
public:
/**
* readTuples returns a NdbResultSet where tuples are stored.
......@@ -58,6 +61,7 @@ public:
int readTuples(LockMode = LM_Read,
Uint32 batch = 0, Uint32 parallel = 0);
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
inline int readTuples(int parallell){
return readTuples(LM_Read, 0, parallell);
}
......@@ -65,9 +69,12 @@ public:
inline int readTuplesExclusive(int parallell = 0){
return readTuples(LM_Exclusive, 0, parallell);
}
#endif
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
NdbBlob* getBlobHandle(const char* anAttrName);
NdbBlob* getBlobHandle(Uint32 anAttrId);
#endif
/**
* Get the next tuple in a scan transaction.
......@@ -145,7 +152,7 @@ public:
* @return an NdbOperation or NULL.
*/
NdbOperation* updateCurrentTuple();
NdbOperation* updateCurrentTuple(NdbConnection* updateTrans);
NdbOperation* updateCurrentTuple(NdbTransaction* updateTrans);
/**
* Transfer scan operation to a deleting transaction. Use this function
......@@ -164,7 +171,7 @@ public:
* @return an NdbOperation or NULL.
*/
int deleteCurrentTuple();
int deleteCurrentTuple(NdbConnection* takeOverTransaction);
int deleteCurrentTuple(NdbTransaction* takeOverTransaction);
protected:
NdbScanOperation(Ndb* aNdb);
......@@ -179,7 +186,7 @@ protected:
int executeCursor(int ProcessorId);
// Overloaded private methods from NdbOperation
int init(const NdbTableImpl* tab, NdbConnection* myConnection);
int init(const NdbTableImpl* tab, NdbTransaction*);
int prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId);
int doSend(int ProcessorId);
void checkForceSend(bool forceSend);
......@@ -187,7 +194,7 @@ protected:
virtual void setErrorCode(int aErrorCode);
virtual void setErrorCodeAbort(int aErrorCode);
NdbConnection *m_transConnection;
NdbTransaction *m_transConnection;
// Scan related variables
Uint32 theParallelism;
......@@ -230,7 +237,7 @@ protected:
void execCLOSE_SCAN_REP();
int getKeyFromKEYINFO20(Uint32* data, unsigned size);
NdbOperation* takeOverScanOp(OperationType opType, NdbConnection*);
NdbOperation* takeOverScanOp(OperationType opType, NdbTransaction*);
bool m_ordered;
bool m_descending;
......@@ -245,7 +252,7 @@ NdbScanOperation::updateCurrentTuple(){
inline
NdbOperation*
NdbScanOperation::updateCurrentTuple(NdbConnection* takeOverTrans){
NdbScanOperation::updateCurrentTuple(NdbTransaction* takeOverTrans){
return takeOverScanOp(NdbOperation::UpdateRequest,
takeOverTrans);
}
......@@ -258,7 +265,7 @@ NdbScanOperation::deleteCurrentTuple(){
inline
int
NdbScanOperation::deleteCurrentTuple(NdbConnection * takeOverTrans){
NdbScanOperation::deleteCurrentTuple(NdbTransaction * takeOverTrans){
void * res = takeOverScanOp(NdbOperation::DeleteRequest,
takeOverTrans);
if(res == 0)
......
This diff is collapsed.
......@@ -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 \
......
This diff is collapsed.
......@@ -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);
......
......@@ -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)
......
/* 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()
{
}
......@@ -35,6 +35,7 @@ public:
#include <NdbError.hpp>
#include <NdbCondition.h>
#include <NdbReceiver.hpp>
#include <NdbTransaction.hpp>
#include <NdbOperation.hpp>
#include <NdbTick.h>
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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 Ronstrm 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;
......
......@@ -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>
......
......@@ -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>
......
......@@ -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;
......
......@@ -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());
......
......@@ -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;
}
......
This diff is collapsed.
......@@ -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>
......
......@@ -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,
......
......@@ -22,7 +22,7 @@
struct restore_callback_t {
class BackupRestore *restore;
class TupleS tup;
class NdbConnection *connection;
class NdbTransaction *connection;
int retries;
int error_code;
restore_callback_t *next;
......
......@@ -29,7 +29,7 @@
class Ndb; // Forward declaration
class NdbOperation; // Forward declaration
class NdbConnection; // Forward declaration
class NdbTransaction; // Forward declaration
class NdbRecAttr; // Forward declaration
class NdbScanOperation;
class NdbIndexScanOperation;
......@@ -210,7 +210,7 @@ class ha_ndbcluster: public handler
void print_results();
ulonglong get_auto_increment();
int ndb_err(NdbConnection*);
int ndb_err(NdbTransaction*);
bool uses_blob_value(bool all_fields);
int write_ndb_file();
......@@ -218,7 +218,7 @@ class ha_ndbcluster: public handler
private:
int check_ndb_connection();
NdbConnection *m_active_trans;
NdbTransaction *m_active_trans;
NdbScanOperation *m_active_cursor;
Ndb *m_ndb;
void *m_table;
......@@ -271,9 +271,9 @@ class ha_ndbcluster: public handler
void no_uncommitted_rows_init(THD *);
void no_uncommitted_rows_reset(THD *);
friend int execute_no_commit(ha_ndbcluster*, NdbConnection*);
friend int execute_commit(ha_ndbcluster*, NdbConnection*);
friend int execute_no_commit_ie(ha_ndbcluster*, NdbConnection*);
friend int execute_no_commit(ha_ndbcluster*, NdbTransaction*);
friend int execute_commit(ha_ndbcluster*, NdbTransaction*);
friend int execute_no_commit_ie(ha_ndbcluster*, NdbTransaction*);
};
bool ndbcluster_init(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment