Description. Perform an index range scan of a table, with optional ordering.
NdbIndexScanOperation* scanIndex ( const NdbRecord* key_record, const NdbRecord* result_record, NdbOperation::LockMode lock_mode = NdbOperation::LM_Read, const unsigned char* result_mask = 0, const NdbIndexScanOperation::IndexBound* bound = 0, const NdbScanOperation::ScanOptions* options = 0, Uint32 sizeOfOptions = 0 )
key_record describes the index to
be scanned. It must be a key record for the index; that is, it
must specify, at a minimum, all of the key columns of the index.
key_record must be created from
the index to be scanned (and not from the underlying table).
result_record describes the rows to
be returned from the scan. For an ordered index scan,
result_record must be a key record for
the index to be scanned; that is, it must include (at a minimum)
all of the columns in the index (the full index key is needed by
the NDB API for merge-sorting the ordered rows returned from each
key_record, the result_record
must be created from the underlying table, and not from the index
to be scanned. Both the
NdbRecord structures must stay in
place until the scan operation is closed.
IndexBound can be
specified either in this call or in a separate call to
To perform a multi-range read, the
scan_flags in the
ScanOptions structure must
SF_MULTIRANGE. Additional bounds can be
added using successive calls to
To specify an equals bound, use the same row pointer for the
high_key with the low and high
inclusive bits set.
To specify additional options, pass a
sizeOfOptions exists To enable
backward compatability for this interface. This parameter
indicates the size of the
ScanOptions structure at the time
the client was compiled, and enables detection of the use of an
If this functionality is not required, this argument can be left
set to 0.
For multi-range scans, the
high_key pointers must be unique.
In other words, it is not permissible to reuse the same row
buffer for several different range bounds within a single scan.
However, it is permissible to use the same row pointer as
high_key in order to specify an
equals bound; it is also permissible to reuse the rows after the
scanIndex() method returns—that is,
they need not remain valid until
can be used for error checking.