backwards compatible name change NdbConnectionto NdbTransaction

removed friend declarations from doxygen
updated some documentation in mgmapi
parent 9e3560fd
...@@ -9,8 +9,7 @@ ndbapiinclude_HEADERS = \ ...@@ -9,8 +9,7 @@ ndbapiinclude_HEADERS = \
ndbapi/ndbapi_limits.h \ ndbapi/ndbapi_limits.h \
ndbapi/Ndb.hpp \ ndbapi/Ndb.hpp \
ndbapi/NdbApi.hpp \ ndbapi/NdbApi.hpp \
ndbapi/NdbConnection.hpp \ ndbapi/NdbTransaction.hpp \
ndbapi/NdbCursorOperation.hpp \
ndbapi/NdbDictionary.hpp \ ndbapi/NdbDictionary.hpp \
ndbapi/NdbError.hpp \ ndbapi/NdbError.hpp \
ndbapi/NdbEventOperation.hpp \ ndbapi/NdbEventOperation.hpp \
......
...@@ -33,7 +33,7 @@ class ScanTabReq { ...@@ -33,7 +33,7 @@ class ScanTabReq {
/** /**
* Sender(s) * Sender(s)
*/ */
friend class NdbConnection; friend class NdbTransaction;
friend class NdbScanOperation; friend class NdbScanOperation;
friend class NdbIndexScanOperation; friend class NdbIndexScanOperation;
...@@ -277,7 +277,7 @@ class ScanTabConf { ...@@ -277,7 +277,7 @@ class ScanTabConf {
/** /**
* Reciver(s) * Reciver(s)
*/ */
friend class NdbConnection; // Reciver friend class NdbTransaction; // Reciver
/** /**
* Sender(s) * Sender(s)
...@@ -345,7 +345,7 @@ class ScanTabRef { ...@@ -345,7 +345,7 @@ class ScanTabRef {
/** /**
* Reciver(s) * Reciver(s)
*/ */
friend class NdbConnection; // Reciver friend class NdbTransaction; // Reciver
/** /**
* Sender(s) * Sender(s)
......
...@@ -33,7 +33,7 @@ class TcCommitConf { ...@@ -33,7 +33,7 @@ class TcCommitConf {
* Reciver(s) * Reciver(s)
*/ */
friend class Ndb; friend class Ndb;
friend class NdbConnection; friend class NdbTransaction;
public: public:
STATIC_CONST( SignalLength = 3 ); STATIC_CONST( SignalLength = 3 );
...@@ -60,7 +60,7 @@ class TcCommitRef { ...@@ -60,7 +60,7 @@ class TcCommitRef {
/** /**
* Reciver(s) * Reciver(s)
*/ */
friend class NdbConnection; friend class NdbTransaction;
public: public:
STATIC_CONST( SignalLength = 4 ); STATIC_CONST( SignalLength = 4 );
......
...@@ -36,7 +36,7 @@ class TcHbRep { ...@@ -36,7 +36,7 @@ class TcHbRep {
/** /**
* Sender(s) * Sender(s)
*/ */
friend class NdbConnection; friend class NdbTransaction;
/** /**
* For printing * For printing
......
...@@ -26,7 +26,7 @@ class TcIndxConf { ...@@ -26,7 +26,7 @@ class TcIndxConf {
* Reciver(s) * Reciver(s)
*/ */
friend class Ndb; friend class Ndb;
friend class NdbConnection; friend class NdbTransaction;
/** /**
* Sender(s) * Sender(s)
......
...@@ -27,7 +27,7 @@ class TcKeyConf { ...@@ -27,7 +27,7 @@ class TcKeyConf {
* Reciver(s) * Reciver(s)
*/ */
friend class Ndb; friend class Ndb;
friend class NdbConnection; friend class NdbTransaction;
friend class Ndbcntr; friend class Ndbcntr;
friend class DbUtil; friend class DbUtil;
......
...@@ -33,7 +33,7 @@ class TcKeyFailConf { ...@@ -33,7 +33,7 @@ class TcKeyFailConf {
* Reciver(s) * Reciver(s)
*/ */
friend class Ndb; friend class Ndb;
friend class NdbConnection; friend class NdbTransaction;
public: public:
STATIC_CONST( SignalLength = 3 ); STATIC_CONST( SignalLength = 3 );
......
...@@ -23,7 +23,7 @@ class TcRollbackRep { ...@@ -23,7 +23,7 @@ class TcRollbackRep {
/** /**
* Sender(s) * Sender(s)
*/ */
friend class NdbConnection; friend class NdbTransaction;
friend class DbUtil; friend class DbUtil;
/** /**
......
...@@ -28,7 +28,7 @@ class TransIdAI { ...@@ -28,7 +28,7 @@ class TransIdAI {
/** /**
* Receiver(s) * Receiver(s)
*/ */
friend class NdbConnection; friend class NdbTransaction;
friend class Dbtc; friend class Dbtc;
friend class Dbutil; friend class Dbutil;
friend class Dblqh; friend class Dblqh;
......
...@@ -363,7 +363,20 @@ extern "C" { ...@@ -363,7 +363,20 @@ extern "C" {
NdbMgmHandle ndb_mgm_create_handle(); NdbMgmHandle ndb_mgm_create_handle();
/** /**
* Set connecst string to management server * Destroy a management server handle
*
* @param handle Management handle
*/
void ndb_mgm_destroy_handle(NdbMgmHandle * handle);
/** @} *********************************************************************/
/**
* @name Functions: Connect/Disconnect Management Server
* @{
*/
/**
* Set connect string to management server
* *
* @param handle Management handle * @param handle Management handle
* @param connect_string Connect string to the management server, * @param connect_string Connect string to the management server,
...@@ -373,23 +386,17 @@ extern "C" { ...@@ -373,23 +386,17 @@ extern "C" {
int ndb_mgm_set_connectstring(NdbMgmHandle handle, int ndb_mgm_set_connectstring(NdbMgmHandle handle,
const char *connect_string); 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 * Get connectstring used for connection
*
* @note returns what the connectstring defaults to if the above call has
* not been performed
* *
* @param handle Management handle * @param handle Management handle
*
* @return connectstring
*/ */
void ndb_mgm_destroy_handle(NdbMgmHandle * handle); const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz);
/** @} *********************************************************************/
/**
* @name Functions: Connect/Disconnect Management Server
* @{
*/
/** /**
* Connect to a management server * Connect to a management server
...@@ -408,6 +415,33 @@ extern "C" { ...@@ -408,6 +415,33 @@ extern "C" {
*/ */
int ndb_mgm_disconnect(NdbMgmHandle handle); 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 * @name Functions: Convert between different data formats
...@@ -436,7 +470,8 @@ extern "C" { ...@@ -436,7 +470,8 @@ extern "C" {
* @param type Node type. * @param type Node type.
* @return NULL if invalid id. * @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 * Convert a string to a ndb_mgm_node_status
...@@ -454,8 +489,10 @@ extern "C" { ...@@ -454,8 +489,10 @@ extern "C" {
*/ */
const char * ndb_mgm_get_node_status_string(enum ndb_mgm_node_status status); 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 *); ndb_mgm_event_category ndb_mgm_match_event_category(const char *);
const char * ndb_mgm_get_event_category_string(enum ndb_mgm_event_category); const char * ndb_mgm_get_event_category_string(enum ndb_mgm_event_category);
#endif
/** @} *********************************************************************/ /** @} *********************************************************************/
/** /**
...@@ -469,6 +506,7 @@ extern "C" { ...@@ -469,6 +506,7 @@ extern "C" {
* Note the caller must free the pointer returned. * Note the caller must free the pointer returned.
* *
* @param handle Management handle. * @param handle Management handle.
*
* @return Cluster state (or NULL on error). * @return Cluster state (or NULL on error).
*/ */
struct ndb_mgm_cluster_state * ndb_mgm_get_status(NdbMgmHandle handle); struct ndb_mgm_cluster_state * ndb_mgm_get_status(NdbMgmHandle handle);
...@@ -488,6 +526,7 @@ extern "C" { ...@@ -488,6 +526,7 @@ extern "C" {
* n - Means stop n node(s) specified in the * n - Means stop n node(s) specified in the
* array node_list * array node_list
* @param node_list List of node ids of database nodes to be stopped * @param node_list List of node ids of database nodes to be stopped
*
* @return No of nodes stopped (or -1 on error) * @return No of nodes stopped (or -1 on error)
* *
* @note The function is equivalent * @note The function is equivalent
...@@ -507,6 +546,7 @@ extern "C" { ...@@ -507,6 +546,7 @@ extern "C" {
* @param node_list List of node ids of database nodes to be stopped * @param node_list List of node ids of database nodes to be stopped
* @param abort Don't perform gracefull stop, * @param abort Don't perform gracefull stop,
* but rather stop immediatly * but rather stop immediatly
*
* @return No of nodes stopped (or -1 on error). * @return No of nodes stopped (or -1 on error).
*/ */
int ndb_mgm_stop2(NdbMgmHandle handle, int no_of_nodes, int ndb_mgm_stop2(NdbMgmHandle handle, int no_of_nodes,
...@@ -521,6 +561,7 @@ extern "C" { ...@@ -521,6 +561,7 @@ extern "C" {
* n - Means stop n node(s) specified in the * n - Means stop n node(s) specified in the
* array node_list * array node_list
* @param node_list List of node ids of database nodes to be stopped * @param node_list List of node ids of database nodes to be stopped
*
* @return No of nodes stopped (or -1 on error). * @return No of nodes stopped (or -1 on error).
* *
* @note The function is equivalent to * @note The function is equivalent to
...@@ -543,6 +584,7 @@ extern "C" { ...@@ -543,6 +584,7 @@ extern "C" {
* waiting for start command * waiting for start command
* @param abort Don't perform gracefull restart, * @param abort Don't perform gracefull restart,
* but rather restart immediatly * but rather restart immediatly
*
* @return No of nodes stopped (or -1 on error). * @return No of nodes stopped (or -1 on error).
*/ */
int ndb_mgm_restart2(NdbMgmHandle handle, int no_of_nodes, int ndb_mgm_restart2(NdbMgmHandle handle, int no_of_nodes,
...@@ -558,6 +600,7 @@ extern "C" { ...@@ -558,6 +600,7 @@ extern "C" {
* n - Means start n node(s) specified in * n - Means start n node(s) specified in
* the array node_list * the array node_list
* @param node_list List of node ids of database nodes to be started * @param node_list List of node ids of database nodes to be started
*
* @return No of nodes started (or -1 on error). * @return No of nodes started (or -1 on error).
* *
* @note The nodes to start must have been started with nostart(-n) * @note The nodes to start must have been started with nostart(-n)
...@@ -582,6 +625,7 @@ extern "C" { ...@@ -582,6 +625,7 @@ extern "C" {
* @param handle NDB management handle. * @param handle NDB management handle.
* @param level A cluster log level to filter. * @param level A cluster log level to filter.
* @param reply Reply message. * @param reply Reply message.
*
* @return -1 on error. * @return -1 on error.
*/ */
int ndb_mgm_filter_clusterlog(NdbMgmHandle handle, int ndb_mgm_filter_clusterlog(NdbMgmHandle handle,
...@@ -592,6 +636,7 @@ extern "C" { ...@@ -592,6 +636,7 @@ extern "C" {
* Get log filter * Get log filter
* *
* @param handle NDB management handle * @param handle NDB management handle
*
* @return A vector of seven elements, * @return A vector of seven elements,
* where each element contains * where each element contains
* 1 if a severity is enabled and 0 if not. * 1 if a severity is enabled and 0 if not.
...@@ -620,7 +665,7 @@ extern "C" { ...@@ -620,7 +665,7 @@ extern "C" {
enum ndb_mgm_event_category category, enum ndb_mgm_event_category category,
int level, int level,
struct ndb_mgm_reply* reply); struct ndb_mgm_reply* reply);
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/** /**
* Set log category and levels for the Node * Set log category and levels for the Node
* *
...@@ -646,6 +691,7 @@ extern "C" { ...@@ -646,6 +691,7 @@ extern "C" {
*/ */
int ndb_mgm_get_stat_port(NdbMgmHandle handle, int ndb_mgm_get_stat_port(NdbMgmHandle handle,
struct ndb_mgm_reply* reply); struct ndb_mgm_reply* reply);
#endif
/** @} *********************************************************************/ /** @} *********************************************************************/
/** /**
...@@ -699,6 +745,7 @@ extern "C" { ...@@ -699,6 +745,7 @@ extern "C" {
* @param handle NDB management handle. * @param handle NDB management handle.
* @param nodeId Node Id of the single user node * @param nodeId Node Id of the single user node
* @param reply Reply message. * @param reply Reply message.
*
* @return -1 on error. * @return -1 on error.
*/ */
int ndb_mgm_exit_single_user(NdbMgmHandle handle, int ndb_mgm_exit_single_user(NdbMgmHandle handle,
...@@ -709,6 +756,7 @@ extern "C" { ...@@ -709,6 +756,7 @@ extern "C" {
* *
* @param filter pairs of { level, category } that will be * @param filter pairs of { level, category } that will be
* pushed to fd, level=0 ends lists * pushed to fd, level=0 ends lists
*
* @return fd which events will be pushed to * @return fd which events will be pushed to
*/ */
int ndb_mgm_listen_event(NdbMgmHandle handle, int filter[]); int ndb_mgm_listen_event(NdbMgmHandle handle, int filter[]);
...@@ -718,12 +766,16 @@ extern "C" { ...@@ -718,12 +766,16 @@ extern "C" {
* @param handle NDB management handle. * @param handle NDB management handle.
* @param version Version of configuration, 0 means latest * @param version Version of configuration, 0 means latest
* @see MAKE_VERSION * @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, struct ndb_mgm_configuration * ndb_mgm_get_configuration(NdbMgmHandle handle,
unsigned version); unsigned version);
void ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *); void ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *);
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
int ndb_mgm_alloc_nodeid(NdbMgmHandle handle, int ndb_mgm_alloc_nodeid(NdbMgmHandle handle,
unsigned version, int nodetype); unsigned version, int nodetype);
/** /**
...@@ -749,6 +801,8 @@ extern "C" { ...@@ -749,6 +801,8 @@ extern "C" {
int param, const char ** value); int param, const char ** value);
int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **); int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **);
int ndb_mgm_check_connection(NdbMgmHandle handle); int ndb_mgm_check_connection(NdbMgmHandle handle);
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
This diff is collapsed.
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "ndbapi_limits.h" #include "ndbapi_limits.h"
#include "Ndb.hpp" #include "Ndb.hpp"
#include "NdbConnection.hpp" #include "NdbTransaction.hpp"
#include "NdbOperation.hpp" #include "NdbOperation.hpp"
#include "NdbScanOperation.hpp" #include "NdbScanOperation.hpp"
#include "NdbIndexOperation.hpp" #include "NdbIndexOperation.hpp"
......
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
#include <ndb_types.h> #include <ndb_types.h>
#include <NdbDictionary.hpp> #include <NdbDictionary.hpp>
#include <NdbConnection.hpp> #include <NdbTransaction.hpp>
#include <NdbError.hpp> #include <NdbError.hpp>
class Ndb; class Ndb;
class NdbConnection; class NdbTransaction;
class NdbOperation; class NdbOperation;
class NdbRecAttr; class NdbRecAttr;
class NdbTableImpl; class NdbTableImpl;
...@@ -67,7 +67,7 @@ class NdbColumnImpl; ...@@ -67,7 +67,7 @@ class NdbColumnImpl;
* cases NdbBlob is forced to do implicit executes. To avoid this, * cases NdbBlob is forced to do implicit executes. To avoid this,
* operate on complete blob parts. * 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 * writes. It avoids execute penalty if nothing is pending. It is not
* needed after execute (obviously) or after next scan result. * needed after execute (obviously) or after next scan result.
* *
...@@ -212,12 +212,14 @@ public: ...@@ -212,12 +212,14 @@ public:
NdbBlob* blobsNextBlob(); NdbBlob* blobsNextBlob();
private: private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class Ndb; friend class Ndb;
friend class NdbConnection; friend class NdbTransaction;
friend class NdbOperation; friend class NdbOperation;
friend class NdbScanOperation; friend class NdbScanOperation;
friend class NdbDictionaryImpl; friend class NdbDictionaryImpl;
friend class NdbResultSet; // atNextResult friend class NdbResultSet; // atNextResult
#endif
// state // state
State theState; State theState;
void setState(State newState); void setState(State newState);
...@@ -226,7 +228,7 @@ private: ...@@ -226,7 +228,7 @@ private:
static void getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnImpl* c); static void getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnImpl* c);
// ndb api stuff // ndb api stuff
Ndb* theNdb; Ndb* theNdb;
NdbConnection* theNdbCon; NdbTransaction* theNdbCon;
NdbOperation* theNdbOp; NdbOperation* theNdbOp;
const NdbTableImpl* theTable; const NdbTableImpl* theTable;
const NdbTableImpl* theAccessTable; const NdbTableImpl* theAccessTable;
...@@ -316,7 +318,7 @@ private: ...@@ -316,7 +318,7 @@ private:
// callbacks // callbacks
int invokeActiveHook(); int invokeActiveHook();
// blob handle maintenance // 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 preExecute(ExecType anExecType, bool& batch);
int postExecute(ExecType anExecType); int postExecute(ExecType anExecType);
int preCommit(); int preCommit();
...@@ -324,7 +326,7 @@ private: ...@@ -324,7 +326,7 @@ private:
// errors // errors
void setErrorCode(int anErrorCode, bool invalidFlag = true); void setErrorCode(int anErrorCode, bool invalidFlag = true);
void setErrorCode(NdbOperation* anOp, 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 #ifdef VM_TRACE
int getOperationType() const; int getOperationType() const;
friend class NdbOut& operator<<(NdbOut&, const NdbBlob&); 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: ...@@ -388,8 +388,10 @@ public:
#endif #endif
private: private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbRecAttr; friend class NdbRecAttr;
friend class NdbColumnImpl; friend class NdbColumnImpl;
#endif
class NdbColumnImpl & m_impl; class NdbColumnImpl & m_impl;
Column(NdbColumnImpl&); Column(NdbColumnImpl&);
Column& operator=(const Column&); Column& operator=(const Column&);
...@@ -646,7 +648,9 @@ public: ...@@ -646,7 +648,9 @@ public:
#endif #endif
private: private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbTableImpl; friend class NdbTableImpl;
#endif
class NdbTableImpl & m_impl; class NdbTableImpl & m_impl;
Table(NdbTableImpl&); Table(NdbTableImpl&);
}; };
...@@ -798,8 +802,9 @@ public: ...@@ -798,8 +802,9 @@ public:
virtual int getObjectVersion() const; virtual int getObjectVersion() const;
private: private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbIndexImpl; friend class NdbIndexImpl;
#endif
class NdbIndexImpl & m_impl; class NdbIndexImpl & m_impl;
Index(NdbIndexImpl&); Index(NdbIndexImpl&);
}; };
...@@ -851,8 +856,10 @@ public: ...@@ -851,8 +856,10 @@ public:
void print(); void print();
private: private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbEventImpl; friend class NdbEventImpl;
friend class NdbEventOperationImpl; friend class NdbEventOperationImpl;
#endif
class NdbEventImpl & m_impl; class NdbEventImpl & m_impl;
Event(NdbEventImpl&); Event(NdbEventImpl&);
}; };
...@@ -1071,9 +1078,11 @@ public: ...@@ -1071,9 +1078,11 @@ public:
~Dictionary(); ~Dictionary();
private: private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbDictionaryImpl; friend class NdbDictionaryImpl;
friend class UtilTransactions; friend class UtilTransactions;
friend class NdbBlob; friend class NdbBlob;
#endif
class NdbDictionaryImpl & m_impl; class NdbDictionaryImpl & m_impl;
Dictionary(NdbDictionaryImpl&); Dictionary(NdbDictionaryImpl&);
const Table * getIndexTable(const char * indexName, const Table * getIndexTable(const char * indexName,
......
...@@ -203,8 +203,10 @@ public: ...@@ -203,8 +203,10 @@ public:
void print(); void print();
private: private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbEventOperationImpl; friend class NdbEventOperationImpl;
friend class Ndb; friend class Ndb;
#endif
NdbEventOperation(Ndb *theNdb, const char* eventName,int bufferLength); NdbEventOperation(Ndb *theNdb, const char* eventName,int bufferLength);
~NdbEventOperation(); ~NdbEventOperation();
static int wait(void *p, int aMillisecondNumber); static int wait(void *p, int aMillisecondNumber);
......
...@@ -14,18 +14,6 @@ ...@@ -14,18 +14,6 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 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 #ifndef NdbIndexOperation_H
#define NdbIndexOperation_H #define NdbIndexOperation_H
...@@ -40,8 +28,10 @@ class NdbResultSet; ...@@ -40,8 +28,10 @@ class NdbResultSet;
*/ */
class NdbIndexOperation : public NdbOperation class NdbIndexOperation : public NdbOperation
{ {
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class Ndb; friend class Ndb;
friend class NdbConnection; friend class NdbTransaction;
#endif
public: public:
/** /**
...@@ -54,16 +44,17 @@ public: ...@@ -54,16 +44,17 @@ public:
/** /**
* Define the NdbIndexOperation to be a standard operation of type readTuple. * 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. * reads a tuple.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
*/ */
int readTuple(LockMode); int readTuple(LockMode);
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/** /**
* Define the NdbIndexOperation to be a standard operation of type readTuple. * 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. * reads a tuple.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
...@@ -73,7 +64,7 @@ public: ...@@ -73,7 +64,7 @@ public:
/** /**
* Define the NdbIndexOperation to be a standard operation of type * Define the NdbIndexOperation to be a standard operation of type
* readTupleExclusive. * readTupleExclusive.
* When calling NdbConnection::execute, this operation * When calling NdbTransaction::execute, this operation
* read a tuple using an exclusive lock. * read a tuple using an exclusive lock.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
...@@ -82,7 +73,7 @@ public: ...@@ -82,7 +73,7 @@ public:
/** /**
* Define the NdbIndexOperation to be a standard operation of type simpleRead. * 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), * reads an existing tuple (using shared read lock),
* but releases lock immediately after read. * but releases lock immediately after read.
* *
...@@ -101,7 +92,7 @@ public: ...@@ -101,7 +92,7 @@ public:
/** /**
* Define the NdbOperation to be a standard operation of type committedRead. * 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. * read latest committed value of the record.
* *
* This means that if another transaction is updating the * This means that if another transaction is updating the
...@@ -113,7 +104,6 @@ public: ...@@ -113,7 +104,6 @@ public:
*/ */
int dirtyRead(); int dirtyRead();
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
int committedRead(); int committedRead();
#endif #endif
...@@ -121,7 +111,7 @@ public: ...@@ -121,7 +111,7 @@ public:
* Define the NdbIndexOperation to be a standard operation of type * Define the NdbIndexOperation to be a standard operation of type
* updateTuple. * updateTuple.
* *
* When calling NdbConnection::execute, this operation * When calling NdbTransaction::execute, this operation
* updates a tuple in the table. * updates a tuple in the table.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
...@@ -132,7 +122,7 @@ public: ...@@ -132,7 +122,7 @@ public:
* Define the NdbIndexOperation to be a standard operation of type * Define the NdbIndexOperation to be a standard operation of type
* deleteTuple. * deleteTuple.
* *
* When calling NdbConnection::execute, this operation * When calling NdbTransaction::execute, this operation
* deletes a tuple. * deletes a tuple.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
...@@ -143,7 +133,7 @@ public: ...@@ -143,7 +133,7 @@ public:
* Define the NdbIndexOperation to be a standard operation of type * Define the NdbIndexOperation to be a standard operation of type
* dirtyUpdate. * dirtyUpdate.
* *
* When calling NdbConnection::execute, this operation * When calling NdbTransaction::execute, this operation
* updates without two-phase commit. * updates without two-phase commit.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
...@@ -181,7 +171,7 @@ private: ...@@ -181,7 +171,7 @@ private:
// Overloaded methods from NdbCursorOperation // Overloaded methods from NdbCursorOperation
int indxInit(const class NdbIndexImpl* anIndex, int indxInit(const class NdbIndexImpl* anIndex,
const class NdbTableImpl* aTable, const class NdbTableImpl* aTable,
NdbConnection* myConnection); NdbTransaction*);
int prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId); int prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId);
......
...@@ -24,11 +24,14 @@ ...@@ -24,11 +24,14 @@
* @brief Class of scan operations for use to scan ordered index * @brief Class of scan operations for use to scan ordered index
*/ */
class NdbIndexScanOperation : public NdbScanOperation { class NdbIndexScanOperation : public NdbScanOperation {
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class Ndb; friend class Ndb;
friend class NdbConnection; friend class NdbTransaction;
friend class NdbResultSet; friend class NdbResultSet;
friend class NdbOperation; friend class NdbOperation;
friend class NdbScanOperation; friend class NdbScanOperation;
#endif
public: public:
/** /**
* readTuples returns a NdbResultSet where tuples are stored. * readTuples returns a NdbResultSet where tuples are stored.
...@@ -50,6 +53,7 @@ public: ...@@ -50,6 +53,7 @@ public:
bool order_desc = false, bool order_desc = false,
bool read_range_no = false); bool read_range_no = false);
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
inline int readTuples(int parallell){ inline int readTuples(int parallell){
return readTuples(LM_Read, 0, parallell, false); return readTuples(LM_Read, 0, parallell, false);
} }
...@@ -57,6 +61,7 @@ public: ...@@ -57,6 +61,7 @@ public:
inline int readTuplesExclusive(int parallell = 0){ inline int readTuplesExclusive(int parallell = 0){
return readTuples(LM_Exclusive, 0, parallell, false); return readTuples(LM_Exclusive, 0, parallell, false);
} }
#endif
/** /**
* Type of ordered index key bound. The values (0-4) will not change * Type of ordered index key bound. The values (0-4) will not change
......
...@@ -27,7 +27,7 @@ class Ndb; ...@@ -27,7 +27,7 @@ class Ndb;
class NdbApiSignal; class NdbApiSignal;
class NdbRecAttr; class NdbRecAttr;
class NdbOperation; class NdbOperation;
class NdbConnection; class NdbTransaction;
class NdbColumnImpl; class NdbColumnImpl;
class NdbBlob; class NdbBlob;
...@@ -37,14 +37,17 @@ class NdbBlob; ...@@ -37,14 +37,17 @@ class NdbBlob;
*/ */
class NdbOperation class NdbOperation
{ {
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class Ndb; friend class Ndb;
friend class NdbConnection; friend class NdbTransaction;
friend class NdbScanOperation; friend class NdbScanOperation;
friend class NdbScanReceiver; friend class NdbScanReceiver;
friend class NdbScanFilter; friend class NdbScanFilter;
friend class NdbScanFilterImpl; friend class NdbScanFilterImpl;
friend class NdbReceiver; friend class NdbReceiver;
friend class NdbBlob; friend class NdbBlob;
#endif
public: public:
/** /**
* @name Define Standard Operation Type * @name Define Standard Operation Type
...@@ -66,7 +69,7 @@ public: ...@@ -66,7 +69,7 @@ public:
/** /**
* Define the NdbOperation to be a standard operation of type insertTuple. * 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. * adds a new tuple to the table.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
...@@ -75,7 +78,7 @@ public: ...@@ -75,7 +78,7 @@ public:
/** /**
* Define the NdbOperation to be a standard operation of type updateTuple. * 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. * updates a tuple in the table.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
...@@ -84,7 +87,7 @@ public: ...@@ -84,7 +87,7 @@ public:
/** /**
* Define the NdbOperation to be a standard operation of type writeTuple. * 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. * writes a tuple to the table.
* If the tuple exists, it updates it, otherwise an insert takes place. * If the tuple exists, it updates it, otherwise an insert takes place.
* *
...@@ -94,7 +97,7 @@ public: ...@@ -94,7 +97,7 @@ public:
/** /**
* Define the NdbOperation to be a standard operation of type deleteTuple. * 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. * delete a tuple.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
...@@ -103,7 +106,7 @@ public: ...@@ -103,7 +106,7 @@ public:
/** /**
* Define the NdbOperation to be a standard operation of type readTuple. * 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. * reads a tuple.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
...@@ -112,17 +115,18 @@ public: ...@@ -112,17 +115,18 @@ public:
/** /**
* Define the NdbOperation to be a standard operation of type readTuple. * 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. * reads a tuple.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
*/ */
virtual int readTuple(); virtual int readTuple();
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/** /**
* Define the NdbOperation to be a standard operation of type * Define the NdbOperation to be a standard operation of type
* readTupleExclusive. * readTupleExclusive.
* When calling NdbConnection::execute, this operation * When calling NdbTransaction::execute, this operation
* read a tuple using an exclusive lock. * read a tuple using an exclusive lock.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
...@@ -132,7 +136,7 @@ public: ...@@ -132,7 +136,7 @@ public:
/** /**
* Define the NdbOperation to be a standard operation of type * Define the NdbOperation to be a standard operation of type
* simpleRead. * simpleRead.
* When calling NdbConnection::execute, this operation * When calling NdbTransaction::execute, this operation
* reads an existing tuple (using shared read lock), * reads an existing tuple (using shared read lock),
* but releases lock immediately after read. * but releases lock immediately after read.
* *
...@@ -149,10 +153,9 @@ public: ...@@ -149,10 +153,9 @@ public:
*/ */
virtual int simpleRead(); virtual int simpleRead();
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/** /**
* Define the NdbOperation to be a standard operation of type committedRead. * 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. * read latest committed value of the record.
* *
* This means that if another transaction is updating the * This means that if another transaction is updating the
...@@ -169,7 +172,7 @@ public: ...@@ -169,7 +172,7 @@ public:
/** /**
* Define the NdbOperation to be a standard operation of type committedRead. * 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. * read latest committed value of the record.
* *
* This means that if another transaction is updating the * This means that if another transaction is updating the
...@@ -183,7 +186,7 @@ public: ...@@ -183,7 +186,7 @@ public:
/** /**
* Define the NdbOperation to be a standard operation of type dirtyUpdate. * 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. * updates without two-phase commit.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
...@@ -192,7 +195,7 @@ public: ...@@ -192,7 +195,7 @@ public:
/** /**
* Define the NdbOperation to be a standard operation of type dirtyWrite. * 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. * writes without two-phase commit.
* *
* @return 0 if successful otherwise -1. * @return 0 if successful otherwise -1.
...@@ -301,7 +304,7 @@ public: ...@@ -301,7 +304,7 @@ public:
* @note This method does not fetch the attribute value from * @note This method does not fetch the attribute value from
* the database! The NdbRecAttr object returned by this method * the database! The NdbRecAttr object returned by this method
* is <em>not</em> readable/printable before the * 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 anAttrName Attribute name
* @param aValue If this is non-NULL, then the attribute value * @param aValue If this is non-NULL, then the attribute value
...@@ -743,7 +746,7 @@ protected: ...@@ -743,7 +746,7 @@ protected:
//-------------------------------------------------------------- //--------------------------------------------------------------
// Initialise after allocating operation to a transaction // Initialise after allocating operation to a transaction
//-------------------------------------------------------------- //--------------------------------------------------------------
int init(const class NdbTableImpl*, NdbConnection* aCon); int init(const class NdbTableImpl*, NdbTransaction* aCon);
void initInterpreter(); void initInterpreter();
void next(NdbOperation*); // Set next pointer void next(NdbOperation*); // Set next pointer
...@@ -775,7 +778,7 @@ protected: ...@@ -775,7 +778,7 @@ protected:
void Status(OperationStatus); // Set the status information void Status(OperationStatus); // Set the status information
void NdbCon(NdbConnection*); // Set reference to connection void NdbCon(NdbTransaction*); // Set reference to connection
// object. // object.
virtual void release(); // Release all operations virtual void release(); // Release all operations
...@@ -812,7 +815,7 @@ protected: ...@@ -812,7 +815,7 @@ protected:
virtual int equal_impl(const NdbColumnImpl*,const char* aValue, Uint32 len); virtual int equal_impl(const NdbColumnImpl*,const char* aValue, Uint32 len);
virtual NdbRecAttr* getValue_impl(const NdbColumnImpl*, char* aValue = 0); virtual NdbRecAttr* getValue_impl(const NdbColumnImpl*, char* aValue = 0);
int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len); 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, Uint32 aValue);
int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue); int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue);
int subValue(const NdbColumnImpl* anAttrObject, Uint32 aValue); int subValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
...@@ -861,7 +864,7 @@ protected: ...@@ -861,7 +864,7 @@ protected:
int theErrorLine; // Error line int theErrorLine; // Error line
Ndb* theNdb; // Point back to the Ndb object. 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. NdbOperation* theNext; // Next pointer to operation.
union { union {
...@@ -1043,14 +1046,14 @@ NdbOperation::Status( OperationStatus aStatus ) ...@@ -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. Remark: Set the reference to the connection in the operation object.
******************************************************************************/ ******************************************************************************/
inline inline
void void
NdbOperation::NdbCon(NdbConnection* aNdbCon) NdbOperation::NdbCon(NdbTransaction* aNdbCon)
{ {
theNdbCon = aNdbCon; theNdbCon = aNdbCon;
} }
......
...@@ -34,7 +34,7 @@ class NdbOperation; ...@@ -34,7 +34,7 @@ class NdbOperation;
* MyRecAttr = MyOperation->getValue("ATTR2", NULL); * MyRecAttr = MyOperation->getValue("ATTR2", NULL);
* if (MyRecAttr == NULL) goto error; * if (MyRecAttr == NULL) goto error;
* *
* if (MyConnection->execute(Commit) == -1) goto error; * if (MyTransaction->execute(Commit) == -1) goto error;
* *
* ndbout << MyRecAttr->u_32_value(); * ndbout << MyRecAttr->u_32_value();
* @endcode * @endcode
...@@ -43,14 +43,14 @@ class NdbOperation; ...@@ -43,14 +43,14 @@ class NdbOperation;
* @ref ndbapi_example2.cpp. * @ref ndbapi_example2.cpp.
* *
* @note The NdbRecAttr object is instantiated with its value when * @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 * undefined. (NdbRecAttr::isNULL can be used to check
* if the value is defined or not.) * if the value is defined or not.)
* This means that an NdbRecAttr object only has valid information * 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 time of Ndb::closeTransaction.
* The value of the null indicator is -1 until the * 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 * For simple types, there are methods which directly getting the value
* from the NdbRecAttr object. * from the NdbRecAttr object.
...@@ -72,12 +72,14 @@ class NdbOperation; ...@@ -72,12 +72,14 @@ class NdbOperation;
*/ */
class NdbRecAttr class NdbRecAttr
{ {
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbOperation; friend class NdbOperation;
friend class NdbIndexScanOperation; friend class NdbIndexScanOperation;
friend class NdbEventOperationImpl; friend class NdbEventOperationImpl;
friend class NdbReceiver; friend class NdbReceiver;
friend class Ndb; friend class Ndb;
friend class NdbOut& operator<<(class NdbOut&, const class AttributeS&); friend class NdbOut& operator<<(class NdbOut&, const class AttributeS&);
#endif
public: public:
/** /**
...@@ -124,7 +126,7 @@ public: ...@@ -124,7 +126,7 @@ public:
* Check if attribute value is NULL. * Check if attribute value is NULL.
* *
* @return -1 = Not defined (Failure or * @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> * 0 = Attribute value is defined, but not equal to NULL.<br>
* 1 = Attribute value is defined and equal to NULL. * 1 = Attribute value is defined and equal to NULL.
*/ */
......
...@@ -22,16 +22,18 @@ ...@@ -22,16 +22,18 @@
#include <ndb_global.h> #include <ndb_global.h>
class Ndb; class Ndb;
class NdbConnection; class NdbTransaction;
class NdbReceiver class NdbReceiver
{ {
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class Ndb; friend class Ndb;
friend class NdbOperation; friend class NdbOperation;
friend class NdbScanOperation; friend class NdbScanOperation;
friend class NdbIndexOperation; friend class NdbIndexOperation;
friend class NdbIndexScanOperation; friend class NdbIndexScanOperation;
friend class NdbConnection; friend class NdbTransaction;
#endif
public: public:
enum ReceiverType { NDB_UNINITIALIZED, enum ReceiverType { NDB_UNINITIALIZED,
NDB_OPERATION = 1, NDB_OPERATION = 1,
...@@ -52,7 +54,7 @@ public: ...@@ -52,7 +54,7 @@ public:
return m_type; return m_type;
} }
inline NdbConnection * getTransaction(); inline NdbTransaction * getTransaction();
void* getOwner(){ void* getOwner(){
return m_owner; return m_owner;
} }
......
...@@ -169,7 +169,9 @@ public: ...@@ -169,7 +169,9 @@ public:
/** @} *********************************************************************/ /** @} *********************************************************************/
private: private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbScanFilterImpl; friend class NdbScanFilterImpl;
#endif
class NdbScanFilterImpl & m_impl; class NdbScanFilterImpl & m_impl;
NdbScanFilter& operator=(const NdbScanFilter&); ///< Defined not implemented NdbScanFilter& operator=(const NdbScanFilter&); ///< Defined not implemented
}; };
......
...@@ -39,11 +39,14 @@ class NdbResultSet; ...@@ -39,11 +39,14 @@ class NdbResultSet;
* @brief Class of scan operations for use in transactions. * @brief Class of scan operations for use in transactions.
*/ */
class NdbScanOperation : public NdbOperation { class NdbScanOperation : public NdbOperation {
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class Ndb; friend class Ndb;
friend class NdbConnection; friend class NdbTransaction;
friend class NdbResultSet; friend class NdbResultSet;
friend class NdbOperation; friend class NdbOperation;
friend class NdbBlob; friend class NdbBlob;
#endif
public: public:
/** /**
* readTuples returns a NdbResultSet where tuples are stored. * readTuples returns a NdbResultSet where tuples are stored.
...@@ -58,6 +61,7 @@ public: ...@@ -58,6 +61,7 @@ public:
int readTuples(LockMode = LM_Read, int readTuples(LockMode = LM_Read,
Uint32 batch = 0, Uint32 parallel = 0); Uint32 batch = 0, Uint32 parallel = 0);
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
inline int readTuples(int parallell){ inline int readTuples(int parallell){
return readTuples(LM_Read, 0, parallell); return readTuples(LM_Read, 0, parallell);
} }
...@@ -65,9 +69,12 @@ public: ...@@ -65,9 +69,12 @@ public:
inline int readTuplesExclusive(int parallell = 0){ inline int readTuplesExclusive(int parallell = 0){
return readTuples(LM_Exclusive, 0, parallell); return readTuples(LM_Exclusive, 0, parallell);
} }
#endif
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
NdbBlob* getBlobHandle(const char* anAttrName); NdbBlob* getBlobHandle(const char* anAttrName);
NdbBlob* getBlobHandle(Uint32 anAttrId); NdbBlob* getBlobHandle(Uint32 anAttrId);
#endif
/** /**
* Get the next tuple in a scan transaction. * Get the next tuple in a scan transaction.
...@@ -145,7 +152,7 @@ public: ...@@ -145,7 +152,7 @@ public:
* @return an NdbOperation or NULL. * @return an NdbOperation or NULL.
*/ */
NdbOperation* updateCurrentTuple(); NdbOperation* updateCurrentTuple();
NdbOperation* updateCurrentTuple(NdbConnection* updateTrans); NdbOperation* updateCurrentTuple(NdbTransaction* updateTrans);
/** /**
* Transfer scan operation to a deleting transaction. Use this function * Transfer scan operation to a deleting transaction. Use this function
...@@ -164,7 +171,7 @@ public: ...@@ -164,7 +171,7 @@ public:
* @return an NdbOperation or NULL. * @return an NdbOperation or NULL.
*/ */
int deleteCurrentTuple(); int deleteCurrentTuple();
int deleteCurrentTuple(NdbConnection* takeOverTransaction); int deleteCurrentTuple(NdbTransaction* takeOverTransaction);
protected: protected:
NdbScanOperation(Ndb* aNdb); NdbScanOperation(Ndb* aNdb);
...@@ -179,7 +186,7 @@ protected: ...@@ -179,7 +186,7 @@ protected:
int executeCursor(int ProcessorId); int executeCursor(int ProcessorId);
// Overloaded private methods from NdbOperation // 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 prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId);
int doSend(int ProcessorId); int doSend(int ProcessorId);
void checkForceSend(bool forceSend); void checkForceSend(bool forceSend);
...@@ -187,7 +194,7 @@ protected: ...@@ -187,7 +194,7 @@ protected:
virtual void setErrorCode(int aErrorCode); virtual void setErrorCode(int aErrorCode);
virtual void setErrorCodeAbort(int aErrorCode); virtual void setErrorCodeAbort(int aErrorCode);
NdbConnection *m_transConnection; NdbTransaction *m_transConnection;
// Scan related variables // Scan related variables
Uint32 theParallelism; Uint32 theParallelism;
...@@ -230,7 +237,7 @@ protected: ...@@ -230,7 +237,7 @@ protected:
void execCLOSE_SCAN_REP(); void execCLOSE_SCAN_REP();
int getKeyFromKEYINFO20(Uint32* data, unsigned size); int getKeyFromKEYINFO20(Uint32* data, unsigned size);
NdbOperation* takeOverScanOp(OperationType opType, NdbConnection*); NdbOperation* takeOverScanOp(OperationType opType, NdbTransaction*);
bool m_ordered; bool m_ordered;
bool m_descending; bool m_descending;
...@@ -245,7 +252,7 @@ NdbScanOperation::updateCurrentTuple(){ ...@@ -245,7 +252,7 @@ NdbScanOperation::updateCurrentTuple(){
inline inline
NdbOperation* NdbOperation*
NdbScanOperation::updateCurrentTuple(NdbConnection* takeOverTrans){ NdbScanOperation::updateCurrentTuple(NdbTransaction* takeOverTrans){
return takeOverScanOp(NdbOperation::UpdateRequest, return takeOverScanOp(NdbOperation::UpdateRequest,
takeOverTrans); takeOverTrans);
} }
...@@ -258,7 +265,7 @@ NdbScanOperation::deleteCurrentTuple(){ ...@@ -258,7 +265,7 @@ NdbScanOperation::deleteCurrentTuple(){
inline inline
int int
NdbScanOperation::deleteCurrentTuple(NdbConnection * takeOverTrans){ NdbScanOperation::deleteCurrentTuple(NdbTransaction * takeOverTrans){
void * res = takeOverScanOp(NdbOperation::DeleteRequest, void * res = takeOverScanOp(NdbOperation::DeleteRequest,
takeOverTrans); takeOverTrans);
if(res == 0) if(res == 0)
......
This diff is collapsed.
...@@ -14,8 +14,8 @@ libndbapi_la_SOURCES = \ ...@@ -14,8 +14,8 @@ libndbapi_la_SOURCES = \
Ndberr.cpp \ Ndberr.cpp \
ndberror.c \ ndberror.c \
NdbErrorOut.cpp \ NdbErrorOut.cpp \
NdbConnection.cpp \ NdbTransaction.cpp \
NdbConnectionScan.cpp \ NdbTransactionScan.cpp \
NdbOperation.cpp \ NdbOperation.cpp \
NdbOperationSearch.cpp \ NdbOperationSearch.cpp \
NdbOperationScan.cpp \ NdbOperationScan.cpp \
......
This diff is collapsed.
...@@ -93,7 +93,7 @@ private: ...@@ -93,7 +93,7 @@ private:
void setDataPtr(Uint32 *); void setDataPtr(Uint32 *);
friend class NdbConnection; friend class NdbTransaction;
friend class NdbScanReceiver; friend class NdbScanReceiver;
friend class Table; friend class Table;
void copyFrom(const NdbApiSignal * src); void copyFrom(const NdbApiSignal * src);
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <Ndb.hpp> #include <Ndb.hpp>
#include <NdbDictionaryImpl.hpp> #include <NdbDictionaryImpl.hpp>
#include <NdbConnection.hpp> #include <NdbTransaction.hpp>
#include <NdbOperation.hpp> #include <NdbOperation.hpp>
#include <NdbIndexOperation.hpp> #include <NdbIndexOperation.hpp>
#include <NdbRecAttr.hpp> #include <NdbRecAttr.hpp>
...@@ -1059,7 +1059,7 @@ NdbBlob::invokeActiveHook() ...@@ -1059,7 +1059,7 @@ NdbBlob::invokeActiveHook()
* data. For read operation adds read of head+inline. * data. For read operation adds read of head+inline.
*/ */
int int
NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* aColumn) NdbBlob::atPrepare(NdbTransaction* aCon, NdbOperation* anOp, const NdbColumnImpl* aColumn)
{ {
assert(theState == Idle); assert(theState == Idle);
// ndb api stuff // ndb api stuff
...@@ -1550,7 +1550,7 @@ NdbBlob::setErrorCode(NdbOperation* anOp, bool invalidFlag) ...@@ -1550,7 +1550,7 @@ NdbBlob::setErrorCode(NdbOperation* anOp, bool invalidFlag)
} }
void void
NdbBlob::setErrorCode(NdbConnection* aCon, bool invalidFlag) NdbBlob::setErrorCode(NdbTransaction* aCon, bool invalidFlag)
{ {
int code = 0; int code = 0;
if (theNdbCon != NULL && (code = theNdbCon->theError.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: ...@@ -35,6 +35,7 @@ public:
#include <NdbError.hpp> #include <NdbError.hpp>
#include <NdbCondition.h> #include <NdbCondition.h>
#include <NdbReceiver.hpp> #include <NdbReceiver.hpp>
#include <NdbTransaction.hpp>
#include <NdbOperation.hpp> #include <NdbOperation.hpp>
#include <NdbTick.h> #include <NdbTick.h>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <ndb_global.h> #include <ndb_global.h>
#include <NdbIndexOperation.hpp> #include <NdbIndexOperation.hpp>
#include <Ndb.hpp> #include <Ndb.hpp>
#include <NdbConnection.hpp> #include <NdbTransaction.hpp>
#include "NdbApiSignal.hpp" #include "NdbApiSignal.hpp"
#include <AttributeHeader.hpp> #include <AttributeHeader.hpp>
#include <signaldata/TcIndx.hpp> #include <signaldata/TcIndx.hpp>
...@@ -53,7 +53,7 @@ NdbIndexOperation::~NdbIndexOperation() ...@@ -53,7 +53,7 @@ NdbIndexOperation::~NdbIndexOperation()
int int
NdbIndexOperation::indxInit(const NdbIndexImpl * anIndex, NdbIndexOperation::indxInit(const NdbIndexImpl * anIndex,
const NdbTableImpl * aTable, const NdbTableImpl * aTable,
NdbConnection* myConnection) NdbTransaction* myConnection)
{ {
NdbOperation::init(aTable, myConnection); NdbOperation::init(aTable, myConnection);
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h> #include <ndb_global.h>
#include <NdbConnection.hpp> #include <NdbTransaction.hpp>
#include <NdbOperation.hpp> #include <NdbOperation.hpp>
#include "NdbApiSignal.hpp" #include "NdbApiSignal.hpp"
#include "NdbRecAttr.hpp" #include "NdbRecAttr.hpp"
...@@ -128,7 +128,7 @@ NdbOperation::setErrorCodeAbort(int anErrorCode) ...@@ -128,7 +128,7 @@ NdbOperation::setErrorCodeAbort(int anErrorCode)
*****************************************************************************/ *****************************************************************************/
int int
NdbOperation::init(const NdbTableImpl* tab, NdbConnection* myConnection){ NdbOperation::init(const NdbTableImpl* tab, NdbTransaction* myConnection){
NdbApiSignal* tSignal; NdbApiSignal* tSignal;
theStatus = Init; theStatus = Init;
theError.code = 0; theError.code = 0;
......
...@@ -14,28 +14,17 @@ ...@@ -14,28 +14,17 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
/***************************************************************************** #include <NdbOperation.hpp>
* 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 "NdbApiSignal.hpp" #include "NdbApiSignal.hpp"
#include "NdbConnection.hpp" #include <NdbTransaction.hpp>
#include "Ndb.hpp" #include <Ndb.hpp>
#include "NdbRecAttr.hpp" #include <NdbRecAttr.hpp>
#include "NdbUtil.hpp" #include "NdbUtil.hpp"
#include "NdbOut.hpp" #include "NdbOut.hpp"
#include "NdbImpl.hpp" #include "NdbImpl.hpp"
#include <NdbIndexScanOperation.hpp> #include <NdbIndexScanOperation.hpp>
#include "NdbBlob.hpp" #include <NdbBlob.hpp>
#include <Interpreter.hpp> #include <Interpreter.hpp>
...@@ -48,7 +37,7 @@ ...@@ -48,7 +37,7 @@
int int
NdbOperation::insertTuple() NdbOperation::insertTuple()
{ {
NdbConnection* tNdbCon = theNdbCon; NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine; int tErrorLine = theErrorLine;
if (theStatus == Init) { if (theStatus == Init) {
theStatus = OperationDefined; theStatus = OperationDefined;
...@@ -68,7 +57,7 @@ NdbOperation::insertTuple() ...@@ -68,7 +57,7 @@ NdbOperation::insertTuple()
int int
NdbOperation::updateTuple() NdbOperation::updateTuple()
{ {
NdbConnection* tNdbCon = theNdbCon; NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine; int tErrorLine = theErrorLine;
if (theStatus == Init) { if (theStatus == Init) {
theStatus = OperationDefined; theStatus = OperationDefined;
...@@ -88,7 +77,7 @@ NdbOperation::updateTuple() ...@@ -88,7 +77,7 @@ NdbOperation::updateTuple()
int int
NdbOperation::writeTuple() NdbOperation::writeTuple()
{ {
NdbConnection* tNdbCon = theNdbCon; NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine; int tErrorLine = theErrorLine;
if (theStatus == Init) { if (theStatus == Init) {
theStatus = OperationDefined; theStatus = OperationDefined;
...@@ -128,7 +117,7 @@ NdbOperation::readTuple(NdbOperation::LockMode lm) ...@@ -128,7 +117,7 @@ NdbOperation::readTuple(NdbOperation::LockMode lm)
int int
NdbOperation::readTuple() NdbOperation::readTuple()
{ {
NdbConnection* tNdbCon = theNdbCon; NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine; int tErrorLine = theErrorLine;
if (theStatus == Init) { if (theStatus == Init) {
theStatus = OperationDefined; theStatus = OperationDefined;
...@@ -149,7 +138,7 @@ NdbOperation::readTuple() ...@@ -149,7 +138,7 @@ NdbOperation::readTuple()
int int
NdbOperation::deleteTuple() NdbOperation::deleteTuple()
{ {
NdbConnection* tNdbCon = theNdbCon; NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine; int tErrorLine = theErrorLine;
if (theStatus == Init) { if (theStatus == Init) {
theStatus = OperationDefined; theStatus = OperationDefined;
...@@ -170,7 +159,7 @@ NdbOperation::deleteTuple() ...@@ -170,7 +159,7 @@ NdbOperation::deleteTuple()
int int
NdbOperation::readTupleExclusive() NdbOperation::readTupleExclusive()
{ {
NdbConnection* tNdbCon = theNdbCon; NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine; int tErrorLine = theErrorLine;
if (theStatus == Init) { if (theStatus == Init) {
theStatus = OperationDefined; theStatus = OperationDefined;
...@@ -247,7 +236,7 @@ NdbOperation::committedRead() ...@@ -247,7 +236,7 @@ NdbOperation::committedRead()
int int
NdbOperation::dirtyUpdate() NdbOperation::dirtyUpdate()
{ {
NdbConnection* tNdbCon = theNdbCon; NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine; int tErrorLine = theErrorLine;
if (theStatus == Init) { if (theStatus == Init) {
theStatus = OperationDefined; theStatus = OperationDefined;
...@@ -270,7 +259,7 @@ NdbOperation::dirtyUpdate() ...@@ -270,7 +259,7 @@ NdbOperation::dirtyUpdate()
int int
NdbOperation::dirtyWrite() NdbOperation::dirtyWrite()
{ {
NdbConnection* tNdbCon = theNdbCon; NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine; int tErrorLine = theErrorLine;
if (theStatus == Init) { if (theStatus == Init) {
theStatus = OperationDefined; theStatus = OperationDefined;
...@@ -293,7 +282,7 @@ NdbOperation::dirtyWrite() ...@@ -293,7 +282,7 @@ NdbOperation::dirtyWrite()
int int
NdbOperation::interpretedUpdateTuple() NdbOperation::interpretedUpdateTuple()
{ {
NdbConnection* tNdbCon = theNdbCon; NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine; int tErrorLine = theErrorLine;
if (theStatus == Init) { if (theStatus == Init) {
theStatus = OperationDefined; theStatus = OperationDefined;
...@@ -316,7 +305,7 @@ NdbOperation::interpretedUpdateTuple() ...@@ -316,7 +305,7 @@ NdbOperation::interpretedUpdateTuple()
int int
NdbOperation::interpretedDeleteTuple() NdbOperation::interpretedDeleteTuple()
{ {
NdbConnection* tNdbCon = theNdbCon; NdbTransaction* tNdbCon = theNdbCon;
int tErrorLine = theErrorLine; int tErrorLine = theErrorLine;
if (theStatus == Init) { if (theStatus == Init) {
theStatus = OperationDefined; theStatus = OperationDefined;
...@@ -578,7 +567,7 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, ...@@ -578,7 +567,7 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo,
}//NdbOperation::setValue() }//NdbOperation::setValue()
NdbBlob* NdbBlob*
NdbOperation::getBlobHandle(NdbConnection* aCon, const NdbColumnImpl* tAttrInfo) NdbOperation::getBlobHandle(NdbTransaction* aCon, const NdbColumnImpl* tAttrInfo)
{ {
NdbBlob* tBlob = theBlobList; NdbBlob* tBlob = theBlobList;
NdbBlob* tLastBlob = NULL; NdbBlob* tLastBlob = NULL;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <ndb_global.h> #include <ndb_global.h>
#include <NdbOperation.hpp> #include <NdbOperation.hpp>
#include <NdbConnection.hpp> #include <NdbTransaction.hpp>
#include "NdbApiSignal.hpp" #include "NdbApiSignal.hpp"
#include <Ndb.hpp> #include <Ndb.hpp>
#include <NdbRecAttr.hpp> #include <NdbRecAttr.hpp>
...@@ -544,7 +544,7 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal) ...@@ -544,7 +544,7 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal)
// blobs want this // blobs want this
if (m_abortOption != AO_IgnoreError) if (m_abortOption != AO_IgnoreError)
{ {
theNdbCon->theReturnStatus = NdbConnection::ReturnFailure; theNdbCon->theReturnStatus = NdbTransaction::ReturnFailure;
} }
theError.code = aSignal->readData(4); theError.code = aSignal->readData(4);
theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4), ao); theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4), ao);
......
...@@ -14,23 +14,11 @@ ...@@ -14,23 +14,11 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <NdbOperation.hpp>
/************************************************************************************************
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 "NdbApiSignal.hpp" #include "NdbApiSignal.hpp"
#include "NdbConnection.hpp" #include <NdbTransaction.hpp>
#include "Ndb.hpp" #include <Ndb.hpp>
#include "NdbRecAttr.hpp" #include <NdbRecAttr.hpp>
#include "NdbUtil.hpp" #include "NdbUtil.hpp"
#include "Interpreter.hpp" #include "Interpreter.hpp"
#include <NdbIndexScanOperation.hpp> #include <NdbIndexScanOperation.hpp>
...@@ -94,7 +82,7 @@ NdbOperation::incCheck(const NdbColumnImpl* tNdbColumnImpl) ...@@ -94,7 +82,7 @@ NdbOperation::incCheck(const NdbColumnImpl* tNdbColumnImpl)
} }
return tNdbColumnImpl->m_attrId; return tNdbColumnImpl->m_attrId;
} else { } else {
if (theNdbCon->theCommitStatus == NdbConnection::Started) if (theNdbCon->theCommitStatus == NdbTransaction::Started)
setErrorCodeAbort(4200); setErrorCodeAbort(4200);
} }
return -1; return -1;
...@@ -146,7 +134,7 @@ NdbOperation::write_attrCheck(const NdbColumnImpl* tNdbColumnImpl) ...@@ -146,7 +134,7 @@ NdbOperation::write_attrCheck(const NdbColumnImpl* tNdbColumnImpl)
} }
return tNdbColumnImpl->m_attrId; return tNdbColumnImpl->m_attrId;
} else { } else {
if (theNdbCon->theCommitStatus == NdbConnection::Started) if (theNdbCon->theCommitStatus == NdbTransaction::Started)
setErrorCodeAbort(4200); setErrorCodeAbort(4200);
} }
return -1; return -1;
...@@ -194,7 +182,7 @@ NdbOperation::read_attrCheck(const NdbColumnImpl* tNdbColumnImpl) ...@@ -194,7 +182,7 @@ NdbOperation::read_attrCheck(const NdbColumnImpl* tNdbColumnImpl)
} }
return tNdbColumnImpl->m_attrId; return tNdbColumnImpl->m_attrId;
} else { } else {
if (theNdbCon->theCommitStatus == NdbConnection::Started) if (theNdbCon->theCommitStatus == NdbTransaction::Started)
setErrorCodeAbort(4200); setErrorCodeAbort(4200);
} }
return -1; return -1;
...@@ -230,7 +218,7 @@ NdbOperation::initial_interpreterCheck() ...@@ -230,7 +218,7 @@ NdbOperation::initial_interpreterCheck()
} }
return 0; return 0;
} else { } else {
if (theNdbCon->theCommitStatus == NdbConnection::Started) if (theNdbCon->theCommitStatus == NdbTransaction::Started)
setErrorCodeAbort(4200); setErrorCodeAbort(4200);
} }
return -1; return -1;
...@@ -256,7 +244,7 @@ NdbOperation::labelCheck() ...@@ -256,7 +244,7 @@ NdbOperation::labelCheck()
} }
return 0; return 0;
} else { } else {
if (theNdbCon->theCommitStatus == NdbConnection::Started) if (theNdbCon->theCommitStatus == NdbTransaction::Started)
setErrorCodeAbort(4200); setErrorCodeAbort(4200);
} }
return -1; return -1;
...@@ -276,7 +264,7 @@ NdbOperation::intermediate_interpreterCheck() ...@@ -276,7 +264,7 @@ NdbOperation::intermediate_interpreterCheck()
} }
return 0; return 0;
} else { } else {
if (theNdbCon->theCommitStatus == NdbConnection::Started) if (theNdbCon->theCommitStatus == NdbTransaction::Started)
setErrorCodeAbort(4200); setErrorCodeAbort(4200);
} }
return -1; return -1;
......
...@@ -31,7 +31,7 @@ Adjust: 971022 UABMNST First version. ...@@ -31,7 +31,7 @@ Adjust: 971022 UABMNST First version.
#include <NdbOperation.hpp> #include <NdbOperation.hpp>
#include "NdbApiSignal.hpp" #include "NdbApiSignal.hpp"
#include <NdbConnection.hpp> #include <NdbTransaction.hpp>
#include <Ndb.hpp> #include <Ndb.hpp>
#include "NdbImpl.hpp" #include "NdbImpl.hpp"
#include <NdbOut.hpp> #include <NdbOut.hpp>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "NdbDictionaryImpl.hpp" #include "NdbDictionaryImpl.hpp"
#include <NdbRecAttr.hpp> #include <NdbRecAttr.hpp>
#include <AttributeHeader.hpp> #include <AttributeHeader.hpp>
#include <NdbConnection.hpp> #include <NdbTransaction.hpp>
#include <TransporterFacade.hpp> #include <TransporterFacade.hpp>
#include <signaldata/TcKeyConf.hpp> #include <signaldata/TcKeyConf.hpp>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <Ndb.hpp> #include <Ndb.hpp>
#include <NdbScanOperation.hpp> #include <NdbScanOperation.hpp>
#include <NdbIndexScanOperation.hpp> #include <NdbIndexScanOperation.hpp>
#include <NdbConnection.hpp> #include <NdbTransaction.hpp>
#include "NdbApiSignal.hpp" #include "NdbApiSignal.hpp"
#include <NdbOut.hpp> #include <NdbOut.hpp>
#include "NdbDictionaryImpl.hpp" #include "NdbDictionaryImpl.hpp"
...@@ -63,7 +63,7 @@ NdbScanOperation::~NdbScanOperation() ...@@ -63,7 +63,7 @@ NdbScanOperation::~NdbScanOperation()
void void
NdbScanOperation::setErrorCode(int aErrorCode){ NdbScanOperation::setErrorCode(int aErrorCode){
NdbConnection* tmp = theNdbCon; NdbTransaction* tmp = theNdbCon;
theNdbCon = m_transConnection; theNdbCon = m_transConnection;
NdbOperation::setErrorCode(aErrorCode); NdbOperation::setErrorCode(aErrorCode);
theNdbCon = tmp; theNdbCon = tmp;
...@@ -71,7 +71,7 @@ NdbScanOperation::setErrorCode(int aErrorCode){ ...@@ -71,7 +71,7 @@ NdbScanOperation::setErrorCode(int aErrorCode){
void void
NdbScanOperation::setErrorCodeAbort(int aErrorCode){ NdbScanOperation::setErrorCodeAbort(int aErrorCode){
NdbConnection* tmp = theNdbCon; NdbTransaction* tmp = theNdbCon;
theNdbCon = m_transConnection; theNdbCon = m_transConnection;
NdbOperation::setErrorCodeAbort(aErrorCode); NdbOperation::setErrorCodeAbort(aErrorCode);
theNdbCon = tmp; theNdbCon = tmp;
...@@ -86,11 +86,11 @@ NdbScanOperation::setErrorCodeAbort(int aErrorCode){ ...@@ -86,11 +86,11 @@ NdbScanOperation::setErrorCodeAbort(int aErrorCode){
* Remark: Initiates operation record after allocation. * Remark: Initiates operation record after allocation.
*****************************************************************************/ *****************************************************************************/
int int
NdbScanOperation::init(const NdbTableImpl* tab, NdbConnection* myConnection) NdbScanOperation::init(const NdbTableImpl* tab, NdbTransaction* myConnection)
{ {
m_transConnection = myConnection; m_transConnection = myConnection;
//NdbConnection* aScanConnection = theNdb->startTransaction(myConnection); //NdbTransaction* aScanConnection = theNdb->startTransaction(myConnection);
NdbConnection* aScanConnection = theNdb->hupp(myConnection); NdbTransaction* aScanConnection = theNdb->hupp(myConnection);
if (!aScanConnection){ if (!aScanConnection){
setErrorCodeAbort(theNdb->getNdbError().code); setErrorCodeAbort(theNdb->getNdbError().code);
return -1; return -1;
...@@ -349,7 +349,7 @@ NdbScanOperation::getFirstATTRINFOScan() ...@@ -349,7 +349,7 @@ NdbScanOperation::getFirstATTRINFOScan()
int int
NdbScanOperation::executeCursor(int nodeId){ NdbScanOperation::executeCursor(int nodeId){
NdbConnection * tCon = theNdbCon; NdbTransaction * tCon = theNdbCon;
TransporterFacade* tp = TransporterFacade::instance(); TransporterFacade* tp = TransporterFacade::instance();
Guard guard(tp->theMutexPtr); Guard guard(tp->theMutexPtr);
...@@ -383,7 +383,7 @@ NdbScanOperation::executeCursor(int nodeId){ ...@@ -383,7 +383,7 @@ NdbScanOperation::executeCursor(int nodeId){
TRACE_DEBUG("The node is stopping when attempting to start a scan"); TRACE_DEBUG("The node is stopping when attempting to start a scan");
setErrorCode(4030); setErrorCode(4030);
}//if }//if
tCon->theCommitStatus = NdbConnection::Aborted; tCon->theCommitStatus = NdbTransaction::Aborted;
}//if }//if
return -1; return -1;
} }
...@@ -856,9 +856,9 @@ NdbScanOperation::doSendScan(int aProcessorId) ...@@ -856,9 +856,9 @@ NdbScanOperation::doSendScan(int aProcessorId)
}//NdbOperation::doSendScan() }//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 * Return Value: A reference to the transferred operation object
* or NULL if no success. * or NULL if no success.
* Remark: Take over the scanning transactions NdbOperation * Remark: Take over the scanning transactions NdbOperation
...@@ -868,8 +868,8 @@ NdbScanOperation::doSendScan(int aProcessorId) ...@@ -868,8 +868,8 @@ NdbScanOperation::doSendScan(int aProcessorId)
* *
* FUTURE IMPLEMENTATION: (This note was moved from header file.) * FUTURE IMPLEMENTATION: (This note was moved from header file.)
* In the future, it will even be possible to transfer * In the future, it will even be possible to transfer
* to a NdbConnection on another Ndb-object. * to a NdbTransaction on another Ndb-object.
* In this case the receiving NdbConnection-object must call * In this case the receiving NdbTransaction-object must call
* a method receiveOpFromScan to actually receive the information. * a method receiveOpFromScan to actually receive the information.
* This means that the updating transactions can be placed * This means that the updating transactions can be placed
* in separate threads and thus increasing the parallelism during * in separate threads and thus increasing the parallelism during
...@@ -896,7 +896,7 @@ NdbScanOperation::getKeyFromKEYINFO20(Uint32* data, unsigned size) ...@@ -896,7 +896,7 @@ NdbScanOperation::getKeyFromKEYINFO20(Uint32* data, unsigned size)
} }
NdbOperation* NdbOperation*
NdbScanOperation::takeOverScanOp(OperationType opType, NdbConnection* pTrans){ NdbScanOperation::takeOverScanOp(OperationType opType, NdbTransaction* pTrans){
Uint32 idx = m_current_api_receiver; Uint32 idx = m_current_api_receiver;
Uint32 last = m_api_receivers_count; Uint32 last = m_api_receivers_count;
......
...@@ -15,22 +15,10 @@ ...@@ -15,22 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 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_global.h>
#include <Ndb.hpp> #include <Ndb.hpp>
#include <NdbConnection.hpp> #include <NdbTransaction.hpp>
#include <NdbOperation.hpp> #include <NdbOperation.hpp>
#include <NdbScanOperation.hpp> #include <NdbScanOperation.hpp>
#include "NdbApiSignal.hpp" #include "NdbApiSignal.hpp"
...@@ -52,7 +40,7 @@ ...@@ -52,7 +40,7 @@
* *
****************************************************************************/ ****************************************************************************/
int int
NdbConnection::receiveSCAN_TABREF(NdbApiSignal* aSignal){ NdbTransaction::receiveSCAN_TABREF(NdbApiSignal* aSignal){
const ScanTabRef * ref = CAST_CONSTPTR(ScanTabRef, aSignal->getDataPtr()); const ScanTabRef * ref = CAST_CONSTPTR(ScanTabRef, aSignal->getDataPtr());
if(checkState_TransId(&ref->transId1)){ if(checkState_TransId(&ref->transId1)){
...@@ -93,7 +81,7 @@ NdbConnection::receiveSCAN_TABREF(NdbApiSignal* aSignal){ ...@@ -93,7 +81,7 @@ NdbConnection::receiveSCAN_TABREF(NdbApiSignal* aSignal){
* *
*****************************************************************************/ *****************************************************************************/
int int
NdbConnection::receiveSCAN_TABCONF(NdbApiSignal* aSignal, NdbTransaction::receiveSCAN_TABCONF(NdbApiSignal* aSignal,
const Uint32 * ops, Uint32 len) const Uint32 * ops, Uint32 len)
{ {
const ScanTabConf * conf = CAST_CONSTPTR(ScanTabConf, aSignal->getDataPtr()); const ScanTabConf * conf = CAST_CONSTPTR(ScanTabConf, aSignal->getDataPtr());
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "NdbImpl.hpp" #include "NdbImpl.hpp"
#include "NdbDictionaryImpl.hpp" #include "NdbDictionaryImpl.hpp"
#include <NdbOperation.hpp> #include <NdbOperation.hpp>
#include <NdbConnection.hpp> #include <NdbTransaction.hpp>
#include <NdbBlob.hpp> #include <NdbBlob.hpp>
...@@ -55,7 +55,7 @@ NdbDictionaryImpl::getNdbError() const { ...@@ -55,7 +55,7 @@ NdbDictionaryImpl::getNdbError() const {
const const
NdbError & NdbError &
NdbConnection::getNdbError() const { NdbTransaction::getNdbError() const {
update(theError); update(theError);
return theError; return theError;
} }
......
This diff is collapsed.
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
#include "NdbApiSignal.hpp" #include "NdbApiSignal.hpp"
#include "NdbImpl.hpp" #include "NdbImpl.hpp"
#include "NdbOperation.hpp" #include <NdbOperation.hpp>
#include "NdbConnection.hpp" #include <NdbTransaction.hpp>
#include "NdbRecAttr.hpp" #include <NdbRecAttr.hpp>
#include "IPCConfig.hpp" #include <IPCConfig.hpp>
#include "TransporterFacade.hpp" #include "TransporterFacade.hpp"
#include "ConfigRetriever.hpp" #include <ConfigRetriever.hpp>
#include <ndb_limits.h> #include <ndb_limits.h>
#include <NdbOut.hpp> #include <NdbOut.hpp>
#include <NdbSleep.h> #include <NdbSleep.h>
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <NdbOperation.hpp> #include <NdbOperation.hpp>
#include <NdbIndexOperation.hpp> #include <NdbIndexOperation.hpp>
#include <NdbIndexScanOperation.hpp> #include <NdbIndexScanOperation.hpp>
#include <NdbConnection.hpp>
#include "NdbApiSignal.hpp" #include "NdbApiSignal.hpp"
#include <NdbRecAttr.hpp> #include <NdbRecAttr.hpp>
#include "NdbUtil.hpp" #include "NdbUtil.hpp"
...@@ -43,10 +42,10 @@ Ndb::checkFailedNode() ...@@ -43,10 +42,10 @@ Ndb::checkFailedNode()
/** /**
* Release all connections in idle list (for node) * Release all connections in idle list (for node)
*/ */
NdbConnection * tNdbCon = theConnectionArray[node_id]; NdbTransaction * tNdbCon = theConnectionArray[node_id];
theConnectionArray[node_id] = NULL; theConnectionArray[node_id] = NULL;
while (tNdbCon != NULL) { while (tNdbCon != NULL) {
NdbConnection* tempNdbCon = tNdbCon; NdbTransaction* tempNdbCon = tNdbCon;
tNdbCon = tNdbCon->next(); tNdbCon = tNdbCon->next();
releaseNdbCon(tempNdbCon); releaseNdbCon(tempNdbCon);
} }
...@@ -88,14 +87,14 @@ NdbImpl::checkErrorCode(Uint32 i, NdbTableImpl * tab){ ...@@ -88,14 +87,14 @@ NdbImpl::checkErrorCode(Uint32 i, NdbTableImpl * tab){
* if createConIdleList was succesful * if createConIdleList was succesful
* Return -1: In all other case. * Return -1: In all other case.
* Parameters: aNrOfCon : Number of connections offered to the application. * Parameters: aNrOfCon : Number of connections offered to the application.
* Remark: Create connection idlelist with NdbConnection objects. * Remark: Create connection idlelist with NdbTransaction objects.
***************************************************************************/ ***************************************************************************/
int int
Ndb::createConIdleList(int aNrOfCon) Ndb::createConIdleList(int aNrOfCon)
{ {
for (int i = 0; i < aNrOfCon; i++) for (int i = 0; i < aNrOfCon; i++)
{ {
NdbConnection* tNdbCon = new NdbConnection(this); NdbTransaction* tNdbCon = new NdbTransaction(this);
if (tNdbCon == NULL) if (tNdbCon == NULL)
{ {
return -1; return -1;
...@@ -109,7 +108,7 @@ Ndb::createConIdleList(int aNrOfCon) ...@@ -109,7 +108,7 @@ Ndb::createConIdleList(int aNrOfCon)
tNdbCon->next(theConIdleList); tNdbCon->next(theConIdleList);
theConIdleList = tNdbCon; theConIdleList = tNdbCon;
} }
tNdbCon->Status(NdbConnection::NotConnected); tNdbCon->Status(NdbTransaction::NotConnected);
} }
theNoOfAllocatedTransactions = aNrOfCon; theNoOfAllocatedTransactions = aNrOfCon;
return aNrOfCon; return aNrOfCon;
...@@ -200,19 +199,19 @@ Ndb::getNdbCall() ...@@ -200,19 +199,19 @@ Ndb::getNdbCall()
} }
/*************************************************************************** /***************************************************************************
* NdbConnection* getNdbCon(); * NdbTransaction* getNdbCon();
* *
* Return Value: Return a connection if the getNdbCon was successful. * Return Value: Return a connection if the getNdbCon was successful.
* Return NULL : In all other case. * Return NULL : In all other case.
* Remark: Get a connection from theConIdleList and return the object . * Remark: Get a connection from theConIdleList and return the object .
***************************************************************************/ ***************************************************************************/
NdbConnection* NdbTransaction*
Ndb::getNdbCon() Ndb::getNdbCon()
{ {
NdbConnection* tNdbCon; NdbTransaction* tNdbCon;
if ( theConIdleList == NULL ) { if ( theConIdleList == NULL ) {
if (theNoOfAllocatedTransactions < theMaxNoOfTransactions) { if (theNoOfAllocatedTransactions < theMaxNoOfTransactions) {
tNdbCon = new NdbConnection(this); tNdbCon = new NdbTransaction(this);
if (tNdbCon == NULL) { if (tNdbCon == NULL) {
return NULL; return NULL;
}//if }//if
...@@ -484,13 +483,13 @@ Ndb::releaseNdbCall(NdbCall* aNdbCall) ...@@ -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. Remark: Add a Connection object into the signal idlelist.
***************************************************************************/ ***************************************************************************/
void void
Ndb::releaseNdbCon(NdbConnection* aNdbCon) Ndb::releaseNdbCon(NdbTransaction* aNdbCon)
{ {
aNdbCon->next(theConIdleList); aNdbCon->next(theConIdleList);
aNdbCon->theMagicNumber = 0xFE11DD; aNdbCon->theMagicNumber = 0xFE11DD;
...@@ -720,7 +719,7 @@ Remark: Always release the first item in the free list ...@@ -720,7 +719,7 @@ Remark: Always release the first item in the free list
void void
Ndb::freeNdbCon() Ndb::freeNdbCon()
{ {
NdbConnection* tNdbCon = theConIdleList; NdbTransaction* tNdbCon = theConIdleList;
theConIdleList = theConIdleList->next(); theConIdleList = theConIdleList->next();
delete tNdbCon; delete tNdbCon;
} }
...@@ -789,14 +788,14 @@ Ndb::freeNdbBlob() ...@@ -789,14 +788,14 @@ Ndb::freeNdbBlob()
} }
/**************************************************************************** /****************************************************************************
int releaseConnectToNdb(NdbConnection* aConnectConnection); int releaseConnectToNdb(NdbTransaction* aConnectConnection);
Return Value: -1 if error Return Value: -1 if error
Parameters: aConnectConnection : Seized schema connection to DBTC Parameters: aConnectConnection : Seized schema connection to DBTC
Remark: Release and disconnect from DBTC a connection and seize it to theConIdleList. Remark: Release and disconnect from DBTC a connection and seize it to theConIdleList.
*****************************************************************************/ *****************************************************************************/
void void
Ndb::releaseConnectToNdb(NdbConnection* a_con) Ndb::releaseConnectToNdb(NdbTransaction* a_con)
{ {
DBUG_ENTER("Ndb::releaseConnectToNdb"); DBUG_ENTER("Ndb::releaseConnectToNdb");
NdbApiSignal tSignal(theMyRef); NdbApiSignal tSignal(theMyRef);
...@@ -814,7 +813,7 @@ Ndb::releaseConnectToNdb(NdbConnection* a_con) ...@@ -814,7 +813,7 @@ Ndb::releaseConnectToNdb(NdbConnection* a_con)
tSignal.setData((tConPtr = a_con->getTC_ConnectPtr()), 1); tSignal.setData((tConPtr = a_con->getTC_ConnectPtr()), 1);
tSignal.setData(theMyRef, 2); tSignal.setData(theMyRef, 2);
tSignal.setData(a_con->ptr2int(), 3); tSignal.setData(a_con->ptr2int(), 3);
a_con->Status(NdbConnection::DisConnecting); a_con->Status(NdbTransaction::DisConnecting);
a_con->theMagicNumber = 0x37412619; a_con->theMagicNumber = 0x37412619;
int ret_code = sendRecSignal(node_id, int ret_code = sendRecSignal(node_id,
WAIT_TC_RELEASE, WAIT_TC_RELEASE,
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
struct restore_callback_t { struct restore_callback_t {
class BackupRestore *restore; class BackupRestore *restore;
class TupleS tup; class TupleS tup;
class NdbConnection *connection; class NdbTransaction *connection;
int retries; int retries;
int error_code; int error_code;
restore_callback_t *next; restore_callback_t *next;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
class Ndb; // Forward declaration class Ndb; // Forward declaration
class NdbOperation; // Forward declaration class NdbOperation; // Forward declaration
class NdbConnection; // Forward declaration class NdbTransaction; // Forward declaration
class NdbRecAttr; // Forward declaration class NdbRecAttr; // Forward declaration
class NdbScanOperation; class NdbScanOperation;
class NdbIndexScanOperation; class NdbIndexScanOperation;
...@@ -210,7 +210,7 @@ class ha_ndbcluster: public handler ...@@ -210,7 +210,7 @@ class ha_ndbcluster: public handler
void print_results(); void print_results();
ulonglong get_auto_increment(); ulonglong get_auto_increment();
int ndb_err(NdbConnection*); int ndb_err(NdbTransaction*);
bool uses_blob_value(bool all_fields); bool uses_blob_value(bool all_fields);
int write_ndb_file(); int write_ndb_file();
...@@ -218,7 +218,7 @@ class ha_ndbcluster: public handler ...@@ -218,7 +218,7 @@ class ha_ndbcluster: public handler
private: private:
int check_ndb_connection(); int check_ndb_connection();
NdbConnection *m_active_trans; NdbTransaction *m_active_trans;
NdbScanOperation *m_active_cursor; NdbScanOperation *m_active_cursor;
Ndb *m_ndb; Ndb *m_ndb;
void *m_table; void *m_table;
...@@ -271,9 +271,9 @@ class ha_ndbcluster: public handler ...@@ -271,9 +271,9 @@ class ha_ndbcluster: public handler
void no_uncommitted_rows_init(THD *); void no_uncommitted_rows_init(THD *);
void no_uncommitted_rows_reset(THD *); void no_uncommitted_rows_reset(THD *);
friend int execute_no_commit(ha_ndbcluster*, NdbConnection*); friend int execute_no_commit(ha_ndbcluster*, NdbTransaction*);
friend int execute_commit(ha_ndbcluster*, NdbConnection*); friend int execute_commit(ha_ndbcluster*, NdbTransaction*);
friend int execute_no_commit_ie(ha_ndbcluster*, NdbConnection*); friend int execute_no_commit_ie(ha_ndbcluster*, NdbTransaction*);
}; };
bool ndbcluster_init(void); 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