MySQL 5.6.14 Source Code Document
|
#include <NdbQueryOperationImpl.hpp>
Classes | |
class | OrderedFragSet |
Public Member Functions | |
Uint32 | getNoOfOperations () const |
Uint32 | getNoOfLeafOperations () const |
NdbQueryOperationImpl & | getQueryOperation (Uint32 ident) const |
NdbQueryOperationImpl * | getQueryOperation (const char *ident) const |
Uint32 | getNoOfParameters () const |
const NdbParamOperand * | getParameter (const char *name) const |
const NdbParamOperand * | getParameter (Uint32 num) const |
NdbQuery::NextResultOutcome | nextResult (bool fetchAllowed, bool forceSend) |
int | close (bool forceSend) |
void | release () |
NdbTransaction & | getNdbTransaction () const |
const NdbError & | getNdbError () const |
void | setErrorCode (int aErrorCode) |
int | assignParameters (const NdbQueryParamValue paramValues[]) |
int | setBound (const NdbRecord *keyRecord, const NdbIndexScanOperation::IndexBound *bound) |
int | prepareSend () |
int | doSend (int aNodeId, bool lastFlag) |
NdbQuery & | getInterface () |
NdbQueryImpl * | getNext () const |
void | setNext (NdbQueryImpl *next) |
const NdbQueryDefImpl & | getQueryDef () const |
bool | execTCKEYCONF () |
void | execCLOSE_SCAN_REP (int errorCode, bool needClose) |
bool | hasCompleted () const |
void | setStartIndicator () |
void | setCommitIndicator () |
int | isPrunable (bool &pruned) |
Uint32 | getRootFragCount () const |
NdbBulkAllocator & | getResultStreamAlloc () |
NdbBulkAllocator & | getTupleSetAlloc () |
NdbBulkAllocator & | getRowBufferAlloc () |
Static Public Member Functions | |
static NdbQueryImpl * | buildQuery (NdbTransaction &trans, const NdbQueryDefImpl &queryDef) |
Friends | |
class | NdbQueryOperationImpl |
NdbOut & | operator<< (NdbOut &out, const class NdbQueryOperationImpl &) |
This class is the internal implementation of the interface defined by NdbQuery. This class should thus not be visible to the application programmer.
Definition at line 92 of file NdbQueryOperationImpl.hpp.
int NdbQueryImpl::assignParameters | ( | const NdbQueryParamValue | paramValues[] | ) |
Assign supplied parameter values to the parameter placeholders created when the query was defined. Values are copied into this NdbQueryImpl object: Memory location used as source for parameter values don't have to be valid after this assignment.
Assign supplied parameter values to the parameter placeholders Created when the query was defined. Values are copied into this NdbQueryImpl object: Memory location used as source for parameter values don't have to be valid after this assignment.
Immediately build the serialized parameter representation in order to avoid storing param values elsewhere until query is executed. Also calculates prunable property, and possibly its hashValue.
Definition at line 1889 of file NdbQueryOperation.cpp.
|
static |
Factory method which instantiate a query from its definition. (There is no public constructor.)
Definition at line 1858 of file NdbQueryOperation.cpp.
int NdbQueryImpl::close | ( | bool | forceSend | ) |
Close query:
BEWARE: Don't refer NdbQueryDef or its NdbQueryOperationDefs after ::close() as the application is allowed to destruct the Def's after this point.
Definition at line 2461 of file NdbQueryOperation.cpp.
int NdbQueryImpl::doSend | ( | int | aNodeId, |
bool | lastFlag | ||
) |
Send prepared signals from this NdbQuery to start execution
Then send the signal:
SCANTABREQ always has 2 mandatory sections and an optional third section Section 0 : List of receiver Ids NDBAPI has allocated for the scan Section 1 : ATTRINFO section Section 2 : Optional KEYINFO section
Definition at line 2961 of file NdbQueryOperation.cpp.
void NdbQueryImpl::execCLOSE_SCAN_REP | ( | int | errorCode, |
bool | needClose | ||
) |
Process SCAN_TABCONF w/ EndOfData which is a 'Close Scan Reply'.
Definition at line 2624 of file NdbQueryOperation.cpp.
bool NdbQueryImpl::execTCKEYCONF | ( | ) |
Process TCKEYCONF message. Return true if query is complete.
Definition at line 2596 of file NdbQueryOperation.cpp.
|
inline |
Get next query in same transaction.
Definition at line 187 of file NdbQueryOperationImpl.hpp.
Uint32 NdbQueryImpl::getNoOfLeafOperations | ( | ) | const |
return number of leaf-operations
Definition at line 2107 of file NdbQueryOperation.cpp.
Uint32 NdbQueryImpl::getNoOfOperations | ( | ) | const |
Return number of operations in query.
Definition at line 2101 of file NdbQueryOperation.cpp.
Uint32 NdbQueryImpl::getNoOfParameters | ( | ) | const |
Return number of parameter operands in query.
Definition at line 2131 of file NdbQueryOperation.cpp.
|
inline |
Get the (transaction independent) definition of this query.
Definition at line 194 of file NdbQueryOperationImpl.hpp.
|
inline |
Get the number of fragments to be read for the root operation.
Definition at line 247 of file NdbQueryOperationImpl.hpp.
|
inline |
Determines if query has completed and may be garbage collected A query is not considder complete until the client has called the ::close() or ::release() method on it.
Definition at line 210 of file NdbQueryOperationImpl.hpp.
int NdbQueryImpl::isPrunable | ( | bool & | pruned | ) |
Check if this is a pruned range scan. A range scan is pruned if the ranges are such that only a subset of the fragments need to be scanned for matching tuples.
pruned | This will be set to true if the operation is a pruned range scan. |
Definition at line 3396 of file NdbQueryOperation.cpp.
NdbQuery::NextResultOutcome NdbQueryImpl::nextResult | ( | bool | fetchAllowed, |
bool | forceSend | ||
) |
Get the next tuple(s) from the global cursor on the query.
fetchAllowed | If true, the method may block while waiting for more results to arrive. Otherwise, the method will return immediately if no more results are buffered in the API. |
forceSend | FIXME: Describe this. |
NdbQueryImpl::nextResult() - The 'global' cursor on the query results
Will itterate and fetch results for all combinations of results from the NdbOperations which this query consists of. Except for the root operations which will follow any optinal ScanOrdering, we have no control of the ordering which the results from the QueryOperations appear in.
Definition at line 2158 of file NdbQueryOperation.cpp.
int NdbQueryImpl::prepareSend | ( | ) |
Prepare for execution.
Scan operations need a own sub-transaction object associated with each query.
Calculate total amount of row buffer space for all operations and fragments.
Allocate and initialize fragment state variables. Will also cause a ResultStream object containing a NdbReceiver to be constructed for each operation in QueryTree
Definition at line 2634 of file NdbQueryOperation.cpp.
void NdbQueryImpl::release | ( | ) |
Deallocate 'this' NdbQuery object and its NdbQueryOperation objects. If not already closed, it will also ::close() the NdbQuery.
Definition at line 2506 of file NdbQueryOperation.cpp.
|
inline |
Mark this query as the last query or operation in a transaction, after which the transaction should be committed. This should only be called for queries where root operation is a lookup.
Definition at line 229 of file NdbQueryOperationImpl.hpp.
void NdbQueryImpl::setErrorCode | ( | int | aErrorCode | ) |
Theses are application errorsthat means that a give method invocation fails, but there is no need to abort the transaction.
Definition at line 2517 of file NdbQueryOperation.cpp.
|
inline |
Mark this query as the first query or operation in a new transaction. This should only be called for queries where root operation is a lookup.
Definition at line 218 of file NdbQueryOperationImpl.hpp.
|
friend |
For debugging.