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

Classes

struct  CodeMetaInfo

Public Member Functions

 NdbInterpretedCode (const NdbDictionary::Table *table=0, Uint32 *buffer=0, Uint32 buffer_word_size=0)
int load_const_null (Uint32 RegDest)
int load_const_u16 (Uint32 RegDest, Uint32 Constant)
int load_const_u32 (Uint32 RegDest, Uint32 Constant)
int load_const_u64 (Uint32 RegDest, Uint64 Constant)
int read_attr (Uint32 RegDest, Uint32 attrId)
int read_attr (Uint32 RegDest, const NdbDictionary::Column *column)
int write_attr (Uint32 attrId, Uint32 RegSource)
int write_attr (const NdbDictionary::Column *column, Uint32 RegSource)
int add_reg (Uint32 RegDest, Uint32 RegSource1, Uint32 RegSource2)
int sub_reg (Uint32 RegDest, Uint32 RegSource1, Uint32 RegSource2)
int def_label (int LabelNum)
int branch_label (Uint32 Label)
int branch_ge (Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
int branch_gt (Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
int branch_le (Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
int branch_lt (Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
int branch_eq (Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
int branch_ne (Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
int branch_ne_null (Uint32 RegLvalue, Uint32 Label)
int branch_eq_null (Uint32 RegLvalue, Uint32 Label)
int branch_col_eq (const void *val, Uint32 unused, Uint32 attrId, Uint32 Label)
int branch_col_ne (const void *val, Uint32 unused, Uint32 attrId, Uint32 Label)
int branch_col_lt (const void *val, Uint32 unused, Uint32 attrId, Uint32 Label)
int branch_col_le (const void *val, Uint32 unused, Uint32 attrId, Uint32 Label)
int branch_col_gt (const void *val, Uint32 unused, Uint32 attrId, Uint32 Label)
int branch_col_ge (const void *val, Uint32 unused, Uint32 attrId, Uint32 Label)
int branch_col_eq_null (Uint32 attrId, Uint32 Label)
int branch_col_ne_null (Uint32 attrId, Uint32 Label)
int branch_col_like (const void *val, Uint32 len, Uint32 attrId, Uint32 Label)
int branch_col_notlike (const void *val, Uint32 len, Uint32 attrId, Uint32 Label)
int branch_col_and_mask_eq_mask (const void *mask, Uint32 unused, Uint32 attrId, Uint32 Label)
int branch_col_and_mask_ne_mask (const void *mask, Uint32 unused, Uint32 attrId, Uint32 Label)
int branch_col_and_mask_eq_zero (const void *mask, Uint32 unused, Uint32 attrId, Uint32 Label)
int branch_col_and_mask_ne_zero (const void *mask, Uint32 unused, Uint32 attrId, Uint32 Label)
int interpret_exit_ok ()
int interpret_exit_nok (Uint32 ErrorCode)
int interpret_exit_nok ()
int interpret_exit_last_row ()
int add_val (Uint32 attrId, Uint32 aValue)
int add_val (Uint32 attrId, Uint64 aValue)
int sub_val (Uint32 attrId, Uint32 aValue)
int sub_val (Uint32 attrId, Uint64 aValue)
int def_sub (Uint32 SubroutineNumber)
int call_sub (Uint32 SubroutineNumber)
int ret_sub ()
int finalise ()
const NdbDictionary::TablegetTable () const
struct NdbErrorgetNdbError () const
Uint32 getWordsUsed () const
int copy (const NdbInterpretedCode &src)

Friends

class NdbOperation
class NdbScanOperation
class NdbQueryOperationImpl
class NdbQueryOptionsImpl

Detailed Description

Definition at line 72 of file NdbInterpretedCode.hpp.

Constructor & Destructor Documentation

NdbInterpretedCode::NdbInterpretedCode ( const NdbDictionary::Table table = 0,
Uint32 *  buffer = 0,
Uint32  buffer_word_size = 0 
)

NdbInterpretedCode constructor

Parameters
tableThe table which this program will be run against. This parameter must be supplied if the program is table specific (i.e. reads from or writes to columns in the table).
bufferPointer to a buffer of 32bit words used to store the program.
buffer_word_sizeLength of the buffer passed in If the program exceeds this length then adding new instructions will fail with error 4518, Too many instructions in interpreted program.

Alternatively, if no buffer is passed, a buffer will be dynamically allocated internally and extended to cope as instructions are added.

Definition at line 40 of file NdbInterpretedCode.cpp.

Member Function Documentation

int NdbInterpretedCode::call_sub ( Uint32  SubroutineNumber)

call_sub Call a subroutine by number. When the subroutine returns, the program will continue executing at the next instruction. Subroutines can be called from the main program, or from subroutines. The maximum stack depth is currently 32.

Space required Buffer Request message call_sub 1 word 1 word

Parameters
SubroutineNumberWhich subroutine to call
Returns
0 if successful, -1 otherwise

Definition at line 889 of file NdbInterpretedCode.cpp.

int NdbInterpretedCode::copy ( const NdbInterpretedCode src)

Makes a deep copy of 'src'

Returns
possible error code.

Each NdbInterpretedCode manages life cycle of m_internal_buffer.

Definition at line 967 of file NdbInterpretedCode.cpp.

Here is the caller graph for this function:

int NdbInterpretedCode::def_sub ( Uint32  SubroutineNumber)

def_subroutine Define a subroutine. Subroutines can only be defined after all main program instructions are defined. Instructions following this, up to the next ret_sub() instruction are part of this subroutine. Subroutine numbers must be contiguous from zero but do not have to be in order.

Space required Buffer Request message def_sub 2 words 0 words

Parameters
SubroutineNumbernumber to identify this subroutine
Returns
0 if successful, -1 otherwise

Definition at line 859 of file NdbInterpretedCode.cpp.

int NdbInterpretedCode::finalise ( )

finalise This method must be called after an Interpreted program is defined and before it is used. It uses the label and subroutine meta information to resolve branch jumps and subroutine calls. It can only be called once. If no instructions have been defined, then it will attempt to add a single interpret_exit_ok instruction before finalisation.

Definition at line 1047 of file NdbInterpretedCode.cpp.

const NdbError & NdbInterpretedCode::getNdbError ( ) const
read

getNdbError This method returns the most recent error associated with this NdbInterpretedCode object.

Definition at line 949 of file NdbInterpretedCode.cpp.

const NdbDictionary::Table * NdbInterpretedCode::getTable ( ) const

getTable() Returns a pointer to the table object representing the table that this NdbInterpretedCode object operates on. This can be NULL if no table object was supplied at construction time.

Definition at line 940 of file NdbInterpretedCode.cpp.

Here is the caller graph for this function:

Uint32 NdbInterpretedCode::getWordsUsed ( ) const

getWordsUsed Returns the number of words of the supplied or internal buffer that have been used.

Definition at line 959 of file NdbInterpretedCode.cpp.

int NdbInterpretedCode::ret_sub ( )

ret_sub Return from a subroutine.

Space required Buffer Request message ret_sub 1 word 1 word

Returns
0 if successful, -1 otherwise

Definition at line 900 of file NdbInterpretedCode.cpp.

Friends And Related Function Documentation

friend class NdbOperation
friend

Sender(s)

Definition at line 544 of file NdbInterpretedCode.hpp.


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