NdbScanFilter Class Reference

A simple way to specify filters for scan operations. More...

#include <NdbScanFilter.hpp>

List of all members.

Public Types

enum  Group { AND = 1, OR = 2, NAND = 3, NOR = 4 }
enum  BinaryCondition {
  COND_LE = 0, COND_LT = 1, COND_GE = 2, COND_GT = 3,
  COND_EQ = 4, COND_NE = 5, COND_LIKE = 6, COND_NOT_LIKE = 7,
  COND_AND_EQ_MASK = 8, COND_AND_NE_MASK = 9, COND_AND_EQ_ZERO = 10, COND_AND_NE_ZERO = 11
}
enum  Error { FilterTooLarge = 4294 }

Public Member Functions

 NdbScanFilter (NdbInterpretedCode *code)
 NdbScanFilter (class NdbOperation *op)
 ~NdbScanFilter ()
int istrue ()
int isfalse ()
int cmp (BinaryCondition cond, int ColId, const void *val, Uint32 len=0)
int isnull (int ColId)
int isnotnull (int ColId)
struct NdbErrorgetNdbError () const
const NdbInterpretedCodegetInterpretedCode () const
NdbOperationgetNdbOperation () const
Grouping
int begin (Group group=AND)
int end ()
Integer Comparators
int eq (int ColId, Uint32 value)
int ne (int ColId, Uint32 value)
int lt (int ColId, Uint32 value)
int le (int ColId, Uint32 value)
int gt (int ColId, Uint32 value)
int ge (int ColId, Uint32 value)
int eq (int ColId, Uint64 value)
int ne (int ColId, Uint64 value)
int lt (int ColId, Uint64 value)
int le (int ColId, Uint64 value)
int gt (int ColId, Uint64 value)
int ge (int ColId, Uint64 value)

Private Member Functions

NdbScanFilteroperator= (const NdbScanFilter &)
 Defined not implemented.

Private Attributes

class NdbScanFilterImpl & m_impl


Detailed Description

A simple way to specify filters for scan operations.

Note:
This filter interface is under development and may change in the future!

Member Enumeration Documentation

Enumerator:
COND_LE  lower bound
COND_LT  lower bound, strict
COND_GE  upper bound
COND_GT  upper bound, strict
COND_EQ  equality
COND_NE  not equal
COND_LIKE  like
COND_NOT_LIKE  not like
COND_AND_EQ_MASK  (bit & mask) == mask
COND_AND_NE_MASK  (bit & mask) != mask (incl. NULL)
COND_AND_EQ_ZERO  (bit & mask) == 0
COND_AND_NE_ZERO  (bit & mask) != 0 (incl. NULL)

Enumerator:
FilterTooLarge 

Group operators

Enumerator:
AND  (x1 AND x2 AND x3)
OR  (x1 OR x2 OR X3)
NAND  NOT (x1 AND x2 AND x3).
NOR  NOT (x1 OR x2 OR x3).


Constructor & Destructor Documentation

NdbScanFilter::NdbScanFilter ( NdbInterpretedCode code  ) 

Constructor Using this constructor, a ScanFilter is created which will build and finalise a scan filter program using the NdbInterpretedCode object passed. Once defined, the generated NdbInterpretedCode object can be used to specify a scan filter for one or more NdbRecord defined ScanOperations on the supplied table. The NdbInterpretedCode object is passed to the ScanTable() or ScanIndex() call via the ScanOptions structure.

Parameters:
code Pointer to the NdbInterpretedCode object to build the ScanFilter in.

NdbScanFilter::NdbScanFilter ( class NdbOperation op  ) 

Constructor This constructor is used to create an ScanFilter object for use with a non-NdbRecord defined ScanOperation.

As part of the filter definition, it is automatically added to the supplied operation. ScanFilters defined this way can only be used with the passed Scan operation.

Parameters:
op The NdbOperation that the filter is applied to. Note that this MUST be an NdbScanOperation or NdbIndexScanOperation object created using the NdbTransaction->getNdbScanOperation() or NdbTransaciton->getNdbIndexScanOperation() methods

NdbScanFilter::~NdbScanFilter (  ) 


Member Function Documentation

int NdbScanFilter::begin ( Group  group = AND  ) 

Begin of compound. If no group type is passed, defaults to AND. ®return 0 if successful, -1 otherwise

int NdbScanFilter::cmp ( BinaryCondition  cond,
int  ColId,
const void *  val,
Uint32  len = 0 
)

Compare column ColId with val

For all BinaryConditions except LIKE and NOT_LIKE, the value pointed to by val should be in normal column format as described in the documentation for NdbOperation::equal(). For BinaryConditions LIKE and NOT_LIKE, the value pointed to by val should NOT include initial length bytes. For LIKE and NOT_LIKE, the % and ? wildcards are supported. For bitmask operations, see the bitmask format information against the branch_col_and_mask_eq_mask instruction in NdbInterpretedCode.hpp

®return 0 if successful, -1 otherwise

int NdbScanFilter::end (  ) 

End of compound. ®return 0 if successful, -1 otherwise

int NdbScanFilter::eq ( int  ColId,
Uint64  value 
) [inline]

Compare column value with integer for equal. 64-bit. ®return 0 if successful, -1 otherwise

int NdbScanFilter::eq ( int  ColId,
Uint32  value 
) [inline]

Compare column value with integer for equal ®return 0 if successful, -1 otherwise

int NdbScanFilter::ge ( int  ColId,
Uint64  value 
) [inline]

Compare column value with integer for greater than or equal. 64-bit. ®return 0 if successful, -1 otherwise

int NdbScanFilter::ge ( int  ColId,
Uint32  value 
) [inline]

Compare column value with integer for greater than or equal. ®return 0 if successful, -1 otherwise

const NdbInterpretedCode* NdbScanFilter::getInterpretedCode (  )  const

Get filter's associated InterpretedCode object. For ScanFilters associated with a non-NdbRecord scan operation, this method always returns NULL.

struct NdbError& NdbScanFilter::getNdbError (  )  const [read]

Get filter level error.

Errors encountered when building a ScanFilter do not propagate to any involved NdbOperation object. This method gives access to error information.

NdbOperation* NdbScanFilter::getNdbOperation (  )  const

Get NdbScanFilter's associated NdbScanOperation

Where the NdbScanFilter was constructed with an NdbOperation this method can be used to obtain a pointer to the NdbOperation object. For other NdbScanFilter objects it will return NULL

int NdbScanFilter::gt ( int  ColId,
Uint64  value 
) [inline]

Compare column value with integer for greater than. 64-bit. ®return 0 if successful, -1 otherwise

int NdbScanFilter::gt ( int  ColId,
Uint32  value 
) [inline]

Compare column value with integer for greater than. ®return 0 if successful, -1 otherwise

int NdbScanFilter::isfalse (  ) 

Define one term of the current group as FALSE ®return 0 if successful, -1 otherwise

int NdbScanFilter::isnotnull ( int  ColId  ) 

Check if column value is non-NULL ®return 0 if successful, -1 otherwise

int NdbScanFilter::isnull ( int  ColId  ) 

Check if column value is NULL ®return 0 if successful, -1 otherwise

int NdbScanFilter::istrue (  ) 

Define one term of the current group as TRUE ®return 0 if successful, -1 otherwise

int NdbScanFilter::le ( int  ColId,
Uint64  value 
) [inline]

Compare column value with integer for less than or equal. 64-bit. ®return 0 if successful, -1 otherwise

int NdbScanFilter::le ( int  ColId,
Uint32  value 
) [inline]

Compare column value with integer for less than or equal. ®return 0 if successful, -1 otherwise

int NdbScanFilter::lt ( int  ColId,
Uint64  value 
) [inline]

Compare column value with integer for less than. 64-bit. ®return 0 if successful, -1 otherwise

int NdbScanFilter::lt ( int  ColId,
Uint32  value 
) [inline]

Compare column value with integer for less than. ®return 0 if successful, -1 otherwise

int NdbScanFilter::ne ( int  ColId,
Uint64  value 
) [inline]

Compare column value with integer for not equal. 64-bit. ®return 0 if successful, -1 otherwise

int NdbScanFilter::ne ( int  ColId,
Uint32  value 
) [inline]

Compare column value with integer for not equal. ®return 0 if successful, -1 otherwise

NdbScanFilter& NdbScanFilter::operator= ( const NdbScanFilter  )  [private]

Defined not implemented.


Member Data Documentation

class NdbScanFilterImpl& NdbScanFilter::m_impl [private]


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

MySQL Cluster Database Blog

Based on MySQL Cluster 7.0.7.

This page is for information only and is not maintained by MySQL or Sun Microsystems - use at your own risk. For an upto date view of the API refer to the header files included with your MySQL Cluster distribution or check the MySQL Cluster API Developer Guide.