Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual

2.3.24.15 NdbInterpretedCode::branch_col_lt()

Description.  This method compares a table column value with an arbitrary constant and jumps to the specified program label if the constant is less than the column value. In NDB 8.0.18 and later, two table column values can be compared instead.

Signature.  Compare a table column value with a constant:

int branch_col_lt
    (
      const void* val,
      Uint32 len,
      Uint32 attrId,
      Uint32 Label
    )

Compare two table column values:

int branch_col_lt
    (
      Uint32 attrId1, 
      Uint32 attrId2, 
      Uint32 label
    )

Parameters.  When comparing a table column value with a constant, this method takes the following four parameters:

  • A constant value (val)

  • The length of the value (in bytes)

  • The attribute ID of the table column whose value is to be compared with val

  • A Label (previously defined using def_label()) to jump to if the constant value is less than the column value

When used to compare two table column values, branch_col_lt() takes the folowwing three parameters:

  • AttrId1: The attribute ID of the first table column whose value is to be compared

  • AttrId2: The attribute ID of the second table column

  • label: Jump to this if the first column value is less than the second

When comparing two table column values, the types of the table column values must be exactly the same. This means that they must have the same length, precision, and scale.

Return value.  0 on success, -1 on failure.