MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NdbQueryImpl Class Reference

#include <NdbQueryOperationImpl.hpp>

Classes

class  OrderedFragSet

Public Member Functions

Uint32 getNoOfOperations () const
Uint32 getNoOfLeafOperations () const
NdbQueryOperationImplgetQueryOperation (Uint32 ident) const
NdbQueryOperationImplgetQueryOperation (const char *ident) const
Uint32 getNoOfParameters () const
const NdbParamOperandgetParameter (const char *name) const
const NdbParamOperandgetParameter (Uint32 num) const
NdbQuery::NextResultOutcome nextResult (bool fetchAllowed, bool forceSend)
int close (bool forceSend)
void release ()
NdbTransactiongetNdbTransaction () const
const NdbErrorgetNdbError () 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)
NdbQuerygetInterface ()
NdbQueryImplgetNext () 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
NdbBulkAllocatorgetResultStreamAlloc ()
NdbBulkAllocatorgetTupleSetAlloc ()
NdbBulkAllocatorgetRowBufferAlloc ()

Static Public Member Functions

static NdbQueryImplbuildQuery (NdbTransaction &trans, const NdbQueryDefImpl &queryDef)

Friends

class NdbQueryOperationImpl
NdbOut & operator<< (NdbOut &out, const class NdbQueryOperationImpl &)

Detailed Description

This class is the internal implementation of the interface defined by NdbQuery. This class should thus not be visible to the application programmer.

See Also
NdbQuery.

Definition at line 92 of file NdbQueryOperationImpl.hpp.

Member Function Documentation

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.

Here is the call graph for this function:

Here is the caller graph for this function:

NdbQueryImpl * NdbQueryImpl::buildQuery ( NdbTransaction trans,
const NdbQueryDefImpl &  queryDef 
)
static

Factory method which instantiate a query from its definition. (There is no public constructor.)

Definition at line 1858 of file NdbQueryOperation.cpp.

Here is the caller graph for this function:

int NdbQueryImpl::close ( bool  forceSend)

Close query:

  • Release datanode resources,
  • Discard pending result sets,
  • Delete internal buffer and structures for receiving results.
  • Disconnect with NdbQueryDef - it might now be destructed .

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.

Here is the call graph for this function:

Here is the caller graph for this function:

int NdbQueryImpl::doSend ( int  aNodeId,
bool  lastFlag 
)

Send prepared signals from this NdbQuery to start execution

Returns
#signals sent, -1 if error.

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

NdbQueryImpl* NdbQueryImpl::getNext ( ) const
inline

Get next query in same transaction.

Definition at line 187 of file NdbQueryOperationImpl.hpp.

Here is the caller graph for this function:

Uint32 NdbQueryImpl::getNoOfLeafOperations ( ) const

return number of leaf-operations

Definition at line 2107 of file NdbQueryOperation.cpp.

Here is the caller graph for this function:

Uint32 NdbQueryImpl::getNoOfOperations ( ) const

Return number of operations in query.

Definition at line 2101 of file NdbQueryOperation.cpp.

Here is the caller graph for this function:

Uint32 NdbQueryImpl::getNoOfParameters ( ) const

Return number of parameter operands in query.

Definition at line 2131 of file NdbQueryOperation.cpp.

const NdbQueryDefImpl& NdbQueryImpl::getQueryDef ( ) const
inline

Get the (transaction independent) definition of this query.

Definition at line 194 of file NdbQueryOperationImpl.hpp.

Here is the caller graph for this function:

Uint32 NdbQueryImpl::getRootFragCount ( ) const
inline

Get the number of fragments to be read for the root operation.

Definition at line 247 of file NdbQueryOperationImpl.hpp.

Here is the caller graph for this function:

bool NdbQueryImpl::hasCompleted ( ) const
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.

Parameters
prunedThis will be set to true if the operation is a pruned range scan.
Returns
0 if ok, -1 in case of error (call getNdbError() for details.)

Definition at line 3396 of file NdbQueryOperation.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

NdbQuery::NextResultOutcome NdbQueryImpl::nextResult ( bool  fetchAllowed,
bool  forceSend 
)

Get the next tuple(s) from the global cursor on the query.

Parameters
fetchAllowedIf 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.
forceSendFIXME: Describe this.
Returns
  • NextResult_error (-1): if unsuccessful,
  • NextResult_gotRow (0): if another tuple was received, and
  • NextResult_scanComplete (1): if there are no more tuples to scan.
  • NextResult_bufferEmpty (2): if there are no more cached records in NdbApi
See Also
NdbQueryOperation::nextResult()

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.

Here is the call graph for this function:

Here is the caller graph for this function:

int NdbQueryImpl::prepareSend ( )

Prepare for execution.

Returns
possible error code.

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.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

void NdbQueryImpl::setCommitIndicator ( )
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.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

void NdbQueryImpl::setStartIndicator ( )
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.

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

NdbOut& operator<< ( NdbOut &  out,
const class NdbQueryOperationImpl  
)
friend

For debugging.


The documentation for this class was generated from the following files: