mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge
ndb/include/ndbapi/Ndb.hpp: Auto merged ndb/include/ndbapi/NdbConnection.hpp: Auto merged ndb/include/ndbapi/NdbIndexOperation.hpp: Auto merged ndb/Epilogue.mk_old: Auto merged ndb/src/common/debugger/signaldata/Makefile_old: Auto merged ndb/src/common/mgmcommon/Makefile_old: Auto merged ndb/src/common/util/Makefile_old: Auto merged ndb/src/kernel/Makefile_old: Auto merged ndb/src/kernel/ndb-main/Main.cpp: Auto merged ndb/src/kernel/ndb-main/Makefile_old: Auto merged ndb/src/kernel/vm/Makefile_old: Auto merged ndb/src/mgmapi/Makefile_old: Auto merged ndb/src/mgmclient/Makefile_old: Auto merged ndb/src/mgmsrv/Makefile_old: Auto merged ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged ndb/src/ndbapi/ClusterMgr.cpp: Auto merged ndb/src/ndbapi/Makefile_old: Auto merged ndb/src/ndbapi/Ndb.cpp: Auto merged ndb/src/ndbapi/NdbApiSignal.cpp: Auto merged ndb/src/ndbapi/NdbConnection.cpp: Auto merged ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged ndb/src/ndbapi/NdbEventOperationImpl.cpp: Auto merged ndb/src/ndbapi/NdbIndexOperation.cpp: Auto merged ndb/src/ndbapi/NdbOperation.cpp: Auto merged ndb/src/ndbapi/NdbOperationDefine.cpp: Auto merged ndb/src/ndbapi/NdbOperationExec.cpp: Auto merged ndb/src/ndbapi/NdbOperationInt.cpp: Auto merged ndb/src/ndbapi/Ndbinit.cpp: Auto merged ndb/src/ndbapi/TransporterFacade.cpp: Auto merged ndb/src/ndbapi/TransporterFacade.hpp: Auto merged ndb/test/ndbapi/Makefile_old: Auto merged ndb/test/ndbapi/ScanFunctions.hpp: Auto merged ndb/test/ndbapi/ScanInterpretTest.hpp: Auto merged ndb/test/ndbapi/testDataBuffers.cpp: Auto merged ndb/test/ndbapi/old_dirs/testBackup/Makefile: Auto merged ndb/test/ndbapi/old_dirs/testGrep/Makefile: Auto merged ndb/test/ndbapi/old_dirs/testGrep/verify/Makefile: Auto merged ndb/test/ndbapi/testDict.cpp: Auto merged ndb/test/ndbapi/testGrep.cpp: Auto merged ndb/test/ndbapi/testIndex.cpp: Auto merged ndb/test/ndbapi/testOIBasic.cpp: Auto merged ndb/test/ndbapi/testSystemRestart.cpp: Auto merged ndb/test/ndbapi/testTimeout.cpp: Auto merged ndb/test/src/Makefile_old: Auto merged ndb/test/src/UtilTransactions.cpp: Auto merged ndb/test/tools/create_index.cpp: Auto merged ndb/tools/select_all.cpp: Auto merged
This commit is contained in:
@ -41,7 +41,8 @@ class NdbOperation
|
||||
friend class NdbScanReceiver;
|
||||
friend class NdbScanFilter;
|
||||
friend class NdbScanFilterImpl;
|
||||
|
||||
friend class NdbReceiver;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @name Define Standard Operation Type
|
||||
@ -194,197 +195,8 @@ public:
|
||||
*/
|
||||
virtual int interpretedDeleteTuple();
|
||||
|
||||
/**
|
||||
* Scan a table to read tuples.
|
||||
*
|
||||
* The operation only sets a temporary read lock while
|
||||
* reading the tuple.
|
||||
* The tuple lock is released when the result of the read reaches the
|
||||
* application.
|
||||
*
|
||||
* @param Parallelism Number of parallel tuple reads are performed
|
||||
* in the scan.
|
||||
* Currently a maximum of 256 parallel tuple
|
||||
* reads are allowed.
|
||||
* The parallelism can in reality be lower
|
||||
* than specified
|
||||
* depending on the number of nodes
|
||||
* in the cluster
|
||||
* @return 0 if successful otherwise -1.
|
||||
*/
|
||||
int openScanRead(Uint32 Parallelism = 16 );
|
||||
|
||||
/**
|
||||
* Scan a table to write or update tuples.
|
||||
*
|
||||
* The operation sets an exclusive lock on the tuple and sends the result
|
||||
* to the application.
|
||||
* Thus when the application reads the data, the tuple is
|
||||
* still locked with an exclusive lock.
|
||||
*
|
||||
* @param parallelism Number of parallel tuple reads are performed
|
||||
* in the scan.
|
||||
* Currently a maximum of 256 parallel tuple
|
||||
* reads are allowed.
|
||||
* The parallelism can in reality be lower
|
||||
* than specified depending on the number
|
||||
* of nodes in the cluster
|
||||
* @return 0 if successful otherwise -1.
|
||||
*
|
||||
*/
|
||||
int openScanExclusive(Uint32 parallelism = 16);
|
||||
|
||||
/**
|
||||
* Scan a table to read tuples.
|
||||
*
|
||||
* The operation only sets a read lock while
|
||||
* reading the tuple.
|
||||
* Thus when the application reads the data, the tuple is
|
||||
* still locked with a read lock.
|
||||
*
|
||||
* @param parallelism Number of parallel tuple reads are performed
|
||||
* in the scan.
|
||||
* Currently a maximum of 256 parallel tuple
|
||||
* reads are allowed.
|
||||
* The parallelism can in reality be lower
|
||||
* than specified
|
||||
* depending on the number of nodes
|
||||
* in the cluster
|
||||
* @return 0 if successful otherwise -1.
|
||||
*/
|
||||
int openScanReadHoldLock(Uint32 parallelism = 16);
|
||||
|
||||
/**
|
||||
* Scan a table to read tuples.
|
||||
*
|
||||
* The operation does not wait for locks held by other transactions
|
||||
* but returns the latest committed tuple instead.
|
||||
*
|
||||
* @param parallelism Number of parallel tuple reads are performed
|
||||
* in the scan.
|
||||
* Currently a maximum of 256 parallel tuple
|
||||
* reads are allowed.
|
||||
* The parallelism can in reality be lower
|
||||
* than specified
|
||||
* depending on the number of nodes
|
||||
* in the cluster
|
||||
* @return 0 if successful otherwise -1.
|
||||
*/
|
||||
int openScanReadCommitted(Uint32 parallelism = 16);
|
||||
|
||||
/** @} *********************************************************************/
|
||||
|
||||
/**
|
||||
* @name Define Range Scan
|
||||
*
|
||||
* A range scan is a scan on an ordered index. The operation is on
|
||||
* the index table but tuples are returned from the primary table.
|
||||
* The index contains all tuples where at least one index key has not
|
||||
* null value.
|
||||
*
|
||||
* A range scan is currently opened via a normal open scan method.
|
||||
* Bounds can be defined for each index key. After setting bounds,
|
||||
* usual scan methods can be used (get value, interpreter, take over).
|
||||
* These operate on the primary table.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Type of ordered index key bound. The values (0-4) will not change
|
||||
* and can be used explicitly (e.g. they could be computed).
|
||||
*/
|
||||
enum BoundType {
|
||||
BoundLE = 0, ///< lower bound,
|
||||
BoundLT = 1, ///< lower bound, strict
|
||||
BoundGE = 2, ///< upper bound
|
||||
BoundGT = 3, ///< upper bound, strict
|
||||
BoundEQ = 4 ///< equality
|
||||
};
|
||||
|
||||
/**
|
||||
* Define bound on index key in range scan.
|
||||
*
|
||||
* Each index key can have not null lower and/or upper bound, or can
|
||||
* be set equal to not null value. The bounds can be defined in any
|
||||
* order but a duplicate definition is an error.
|
||||
*
|
||||
* The scan is most effective when bounds are given for an initial
|
||||
* sequence of non-nullable index keys, and all but the last one is an
|
||||
* equality. In this case the scan returns a contiguous range from
|
||||
* each ordered index fragment.
|
||||
*
|
||||
* @note This release implements only the case described above,
|
||||
* except for the non-nullable limitation. Other sets of
|
||||
* bounds return error or empty result set.
|
||||
*
|
||||
* @note In this release a null key value satisfies any lower
|
||||
* bound and no upper bound. This may change.
|
||||
*
|
||||
* @param attrName Attribute name, alternatively:
|
||||
* @param anAttrId Index column id (starting from 0).
|
||||
* @param type Type of bound
|
||||
* @param value Pointer to bound value
|
||||
* @param len Value length in bytes.
|
||||
* Fixed per datatype and can be omitted
|
||||
* @return 0 if successful otherwise -1
|
||||
*/
|
||||
int setBound(const char* anAttrName, int type, const void* aValue, Uint32 len = 0);
|
||||
|
||||
/**
|
||||
* Define bound on index key in range scan using index column id.
|
||||
* See the other setBound() method for details.
|
||||
*/
|
||||
int setBound(Uint32 anAttrId, int type, const void* aValue, Uint32 len = 0);
|
||||
|
||||
/** @} *********************************************************************/
|
||||
|
||||
/**
|
||||
* Validate parallelism parameter by checking the number
|
||||
* against number of executing Ndb nodes.
|
||||
*
|
||||
* @param Parallelism
|
||||
* @return 0 if correct parallelism value, otherwise -1.
|
||||
*
|
||||
*/
|
||||
int checkParallelism(Uint32 Parallelism);
|
||||
|
||||
/**
|
||||
* Transfer scan operation to an updating transaction. Use this function
|
||||
* when a scan has found a record that you want to update.
|
||||
* 1. Start a new transaction.
|
||||
* 2. Call the function takeOverForUpdate using your new transaction
|
||||
* as parameter, all the properties of the found record will be copied
|
||||
* to the new transaction.
|
||||
* 3. When you execute the new transaction, the lock held by the scan will
|
||||
* be transferred to the new transaction(it's taken over).
|
||||
*
|
||||
* @note You must have started the scan with openScanExclusive
|
||||
* to be able to update the found tuple.
|
||||
*
|
||||
* @param updateTrans the update transaction connection.
|
||||
* @return an NdbOperation or NULL.
|
||||
*/
|
||||
NdbOperation* takeOverForUpdate(NdbConnection* updateTrans);
|
||||
|
||||
/**
|
||||
* Transfer scan operation to a deleting transaction. Use this function
|
||||
* when a scan has found a record that you want to delete.
|
||||
* 1. Start a new transaction.
|
||||
* 2. Call the function takeOverForDelete using your new transaction
|
||||
* as parameter, all the properties of the found record will be copied
|
||||
* to the new transaction.
|
||||
* 3. When you execute the new transaction, the lock held by the scan will
|
||||
* be transferred to the new transaction(its taken over).
|
||||
*
|
||||
* @note You must have started the scan with openScanExclusive
|
||||
* to be able to delete the found tuple.
|
||||
*
|
||||
* @param deleteTrans the delete transaction connection.
|
||||
* @return an NdbOperation or NULL.
|
||||
*/
|
||||
NdbOperation* takeOverForDelete(NdbConnection* deleteTrans);
|
||||
|
||||
/**
|
||||
* @name Specify Search Conditions
|
||||
* @{
|
||||
@ -865,16 +677,7 @@ protected:
|
||||
// Initialise after allocating operation to a transaction
|
||||
//--------------------------------------------------------------
|
||||
int init(class NdbTableImpl*, NdbConnection* aCon);
|
||||
|
||||
void initScan(); // Initialise after allocating operation
|
||||
// to a scan transaction
|
||||
virtual void releaseScan(); // Release scan parts of transaction
|
||||
void releaseSignals();
|
||||
void releaseScanSignals();
|
||||
void prepareNextScanResult();
|
||||
|
||||
// Common part for Read and Exclusive
|
||||
int openScan(Uint32 aParallelism, bool, bool, bool);
|
||||
void initInterpreter();
|
||||
|
||||
void next(NdbOperation*); // Set next pointer
|
||||
|
||||
@ -920,11 +723,6 @@ protected:
|
||||
*****************************************************************************/
|
||||
|
||||
int doSend(int ProcessorId, Uint32 lastFlag);
|
||||
int doSendScan(int ProcessorId);
|
||||
|
||||
int prepareSendScan(Uint32 TC_ConnectPtr,
|
||||
Uint64 TransactionId);
|
||||
|
||||
virtual int prepareSend(Uint32 TC_ConnectPtr,
|
||||
Uint64 TransactionId);
|
||||
virtual void setLastFlag(NdbApiSignal* signal, Uint32 lastFlag);
|
||||
@ -951,7 +749,7 @@ protected:
|
||||
virtual int equal_impl(const NdbColumnImpl* anAttrObject,
|
||||
const char* aValue,
|
||||
Uint32 len);
|
||||
NdbRecAttr* getValue(const NdbColumnImpl* anAttrObject, char* aValue = 0);
|
||||
NdbRecAttr* getValue_impl(const NdbColumnImpl* anAttrObject, char* aValue = 0);
|
||||
int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len);
|
||||
int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
|
||||
int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue);
|
||||
@ -962,15 +760,12 @@ protected:
|
||||
int branch_reg_reg(Uint32 type, Uint32, Uint32, Uint32);
|
||||
int branch_col(Uint32 type, Uint32, const char *, Uint32, bool, Uint32 Label);
|
||||
int branch_col_null(Uint32 type, Uint32 col, Uint32 Label);
|
||||
int setBound(const NdbColumnImpl* anAttrObject, int type, const void* aValue, Uint32 len);
|
||||
|
||||
// Handle ATTRINFO signals
|
||||
int receiveREAD_AI(Uint32* aDataPtr, Uint32 aLength);
|
||||
|
||||
int insertATTRINFO(Uint32 aData);
|
||||
int insertATTRINFOloop(const Uint32* aDataPtr, Uint32 aLength);
|
||||
int getFirstATTRINFOScan();
|
||||
int saveBoundATTRINFO();
|
||||
|
||||
int insertKEYINFO(const char* aValue,
|
||||
Uint32 aStartPosition,
|
||||
@ -994,9 +789,6 @@ protected:
|
||||
|
||||
Uint32 ptr2int() { return theReceiver.getId(); };
|
||||
|
||||
NdbOperation*
|
||||
takeOverScanOp(OperationType opType, NdbConnection* updateTrans);
|
||||
|
||||
/******************************************************************************
|
||||
* These are the private variables that are defined in the operation objects.
|
||||
*****************************************************************************/
|
||||
@ -1009,7 +801,6 @@ protected:
|
||||
Ndb* theNdb; // Point back to the Ndb object.
|
||||
NdbConnection* theNdbCon; // Point back to the connection object.
|
||||
NdbOperation* theNext; // Next pointer to operation.
|
||||
NdbOperation* theNextScanOp;
|
||||
NdbApiSignal* theTCREQ; // The TC[KEY/INDX]REQ signal object
|
||||
NdbApiSignal* theFirstATTRINFO; // The first ATTRINFO signal object
|
||||
NdbApiSignal* theCurrentATTRINFO; // The current ATTRINFO signal object
|
||||
@ -1020,9 +811,6 @@ protected:
|
||||
NdbApiSignal* theFirstKEYINFO; // The first KEYINFO signal object
|
||||
NdbApiSignal* theLastKEYINFO; // The first KEYINFO signal object
|
||||
|
||||
NdbRecAttr* theFirstRecAttr; // The first receive attribute object
|
||||
NdbRecAttr* theCurrentRecAttr; // The current receive attribute object
|
||||
|
||||
class NdbLabel* theFirstLabel;
|
||||
class NdbLabel* theLastLabel;
|
||||
class NdbBranch* theFirstBranch;
|
||||
@ -1037,11 +825,6 @@ protected:
|
||||
Uint32* theKEYINFOptr; // Pointer to where to write KEYINFO
|
||||
Uint32* theATTRINFOptr; // Pointer to where to write ATTRINFO
|
||||
|
||||
Uint32 theTotalRecAI_Len; // The total length received according
|
||||
// to the TCKEYCONF signal
|
||||
Uint32 theCurrRecAI_Len; // The currently received length
|
||||
Uint32 theAI_ElementLen; // How many words long is this element
|
||||
Uint32* theCurrElemPtr; // The current pointer to the element
|
||||
class NdbTableImpl* m_currentTable; // The current table
|
||||
class NdbTableImpl* m_accessTable;
|
||||
|
||||
@ -1083,15 +866,6 @@ protected:
|
||||
Uint16 m_keyInfoGSN;
|
||||
Uint16 m_attrInfoGSN;
|
||||
|
||||
// Scan related variables
|
||||
Uint32 theParallelism;
|
||||
NdbScanReceiver** theScanReceiversArray;
|
||||
NdbApiSignal* theSCAN_TABREQ;
|
||||
NdbApiSignal* theFirstSCAN_TABINFO_Send;
|
||||
NdbApiSignal* theLastSCAN_TABINFO_Send;
|
||||
NdbApiSignal* theFirstSCAN_TABINFO_Recv;
|
||||
NdbApiSignal* theLastSCAN_TABINFO_Recv;
|
||||
NdbApiSignal* theSCAN_TABCONF_Recv;
|
||||
// saveBoundATTRINFO() moves ATTRINFO here when setBound() is ready
|
||||
NdbApiSignal* theBoundATTRINFO;
|
||||
Uint32 theTotalBoundAI_Len;
|
||||
|
Reference in New Issue
Block a user