[+/-]
- 2.3.24.1 Using NdbInterpretedCode
- 2.3.24.2 NdbInterpretedCode Constructor
- 2.3.24.3 NdbInterpretedCode::add_reg()
- 2.3.24.4 NdbInterpretedCode::add_val()
- 2.3.24.5 NdbInterpretedCode::branch_col_and_mask_eq_mask()
- 2.3.24.6 NdbInterpretedCode::branch_col_and_mask_eq_zero()
- 2.3.24.7 NdbInterpretedCode::branch_col_and_mask_ne_mask()
- 2.3.24.8 NdbInterpretedCode::branch_col_and_mask_ne_zero()
- 2.3.24.9 NdbInterpretedCode::branch_col_eq()
- 2.3.24.10 NdbInterpretedCode::branch_col_eq_null()
- 2.3.24.11 NdbInterpretedCode::branch_col_ge()
- 2.3.24.12 NdbInterpretedCode::branch_col_gt()
- 2.3.24.13 NdbInterpretedCode::branch_col_le()
- 2.3.24.14 NdbInterpretedCode::branch_col_like()
- 2.3.24.15 NdbInterpretedCode::branch_col_lt()
- 2.3.24.16 NdbInterpretedCode::branch_col_ne()
- 2.3.24.17 NdbInterpretedCode::branch_col_ne_null()
- 2.3.24.18 NdbInterpretedCode::branch_col_notlike()
- 2.3.24.19 NdbInterpretedCode::branch_eq()
- 2.3.24.20 NdbInterpretedCode::branch_eq_null()
- 2.3.24.21 NdbInterpretedCode::branch_ge()
- 2.3.24.22 NdbInterpretedCode::branch_gt()
- 2.3.24.23 NdbInterpretedCode::branch_label()
- 2.3.24.24 NdbInterpretedCode::branch_le()
- 2.3.24.25 NdbInterpretedCode::branch_lt()
- 2.3.24.26 NdbInterpretedCode::branch_ne()
- 2.3.24.27 NdbInterpretedCode::branch_ne_null()
- 2.3.24.28 NdbInterpretedCode::call_sub()
- 2.3.24.29 NdbInterpretedCode::copy()
- 2.3.24.30 NdbInterpretedCode::def_label()
- 2.3.24.31 NdbInterpretedCode::def_sub()
- 2.3.24.32 NdbInterpretedCode::finalise()
- 2.3.24.33 NdbInterpretedCode::getNdbError()
- 2.3.24.34 NdbInterpretedCode::getTable()
- 2.3.24.35 NdbInterpretedCode::getWordsUsed()
- 2.3.24.36 NdbInterpretedCode::interpret_exit_last_row()
- 2.3.24.37 NdbInterpretedCode::interpret_exit_nok()
- 2.3.24.38 NdbInterpretedCode::interpret_exit_ok()
- 2.3.24.39 NdbInterpretedCode::load_const_null()
- 2.3.24.40 NdbInterpretedCode::load_const_u16()
- 2.3.24.41 NdbInterpretedCode::load_const_u32()
- 2.3.24.42 NdbInterpretedCode::load_const_u64()
- 2.3.24.43 NdbInterpretedCode::read_attr()
- 2.3.24.44 NdbInterpretedCode::ret_sub()
- 2.3.24.45 NdbInterpretedCode::sub_reg()
- 2.3.24.46 NdbInterpretedCode::sub_val()
- 2.3.24.47 NdbInterpretedCode::write_attr()
Abstract
This section discusses the NdbInterpretedCode
class, which can be used to prepare and execute an NDB API
interpreted program.
Parent class. None.
Child classes. None.
Description.
NdbInterpretedCode represents an interpreted
program for use in operations created using
NdbRecord, or with scans created
using the old API. The
NdbScanFilter class can also be
used to generate an NDB interpreted program using this class.
This interface is still under development, and so is subject to
change without notice. The
NdbScanFilter API is a more
stable API for defining scanning and filtering programs.
Using NdbInterpretedCode.
To create an NdbInterpretedCode object, invoke
the constructor, optionally supplying a table for the program to
operate on, and a buffer for program storage and finalization. If
no table is supplied, then only instructions which do not access
table attributes can be used.
Each NDB API operation applies to one table, and so does any
NdbInterpretedCode program attached to that
operation.
If no buffer is supplied, then an internal buffer is dynamically
allocated and extended as necessary. Once the
NdbInterpretedCode object is created, you can add
instructions and labels to it by calling the appropriate methods as
described later in this section. When the program has completed,
finalize it by calling the finalise() method,
which resolves any remaining internal branches and calls to label
and subroutine offsets.
A single finalized NdbInterpretedCode program
can be used by more than one operation. It need not be re-prepared
for successive operations.
To use the program with NdbRecord
operations and scans, pass it at operation definition time using the
OperationOptions or
ScanOptions parameter. When the
program is no longer required, the
NdbInterpretedCode object can be deleted, along
with any user-supplied buffer.
Error checking. For reasons of efficiency, methods of this class provide minimal error checking.
Methods. The following table lists the public methods of this class and the purpose or use of each method:
| Method | Purpose / Use |
|---|---|
NdbInterpretedCode() |
Class constructor |
add_reg() |
Add two register values and store the result in a third register |
add_val() |
Add a value to a table column value |
branch_col_and_mask_eq_mask() |
Jump if a column value ANDed with a bitmask is equal
to the bitmask |
branch_col_and_mask_eq_zero() |
Jump if a column value ANDed with a bitmask is equal
to 0
|
branch_col_and_mask_ne_mask() |
Jump if a column value ANDed with a bitmask is not
equal to the bitmask |
branch_col_and_mask_ne_zero() |
Jump if a column value ANDed with a bitmask is not
equal to 0
|
branch_col_eq() |
Jump if a column value is equal to another |
branch_col_eq_null() |
Jump if a column value is NULL
|
branch_col_ge() |
Jump if a column value is greater than or equal to another |
branch_col_gt() |
Jump if a column value is greater than another |
branch_col_le() |
Jump if a column value is less than or equal to another |
branch_col_like() |
Jump if a column value matches a pattern |
branch_col_lt() |
Jump if a column value is less than another |
branch_col_ne() |
Jump if a column value is not equal to another |
branch_col_ne_null() |
Jump if a column value is not NULL
|
branch_col_notlike() |
Jump if a column value does not match a pattern |
branch_eq() |
Jump if one register value is equal to another |
branch_eq_null() |
Jump if a register value is NULL
|
branch_ge() |
Jump if one register value is greater than or equal to another |
branch_gt() |
Jump if one register value is greater than another |
branch_label() |
Unconditional jump to a label |
branch_le() |
Jump if one register value is less than or equal to another |
branch_lt() |
Jump if one register value is less than another |
branch_ne() |
Jump if one register value is not equal to another |
branch_ne_null() |
Jump if a register value is not NULL
|
call_sub() |
Call a subroutine |
copy() |
Make a deep copy of an
NdbInterpretedCode object |
def_label() |
Create a label for use within the interpreted program |
def_sub() |
Define a subroutine |
finalise() |
Completes interpreted program and prepares it for use |
getNdbError() |
Gets the most recent error associated with this
NdbInterpretedCode object |
getTable() |
Gets the table on which the program is defined |
getWordsUsed() |
Gets the number of words used in the buffer |
interpret_exit_last_row() |
Return a row as part of the result, and do not check any more rows in this fragment |
interpret_exit_nok() |
Do not return a row as part of the result |
interpret_exit_ok() |
Return a row as part of the result |
load_const_null() |
Load a NULL value into a register |
load_const_u16() |
Load a 16-bit numeric value into a register |
load_const_u32() |
Load a 32-bit numeric value into a register |
load_const_u64() |
Load a 64-bit numeric value into a register |
read_attr() |
Read a register value into a table column |
ret_sub() |
Return from a subroutine |
sub_reg() |
Subtract two register values and store the result in a third register |
sub_val() |
Subtract a value from a table column value |
write_attr() |
Write a table column value into a register |
See also Section 2.3.24.1, “Using NdbInterpretedCode”.
Types. This class defines no public types.
Class diagram.
This diagram shows all the available methods of the
NdbInterpretedCode class:
