Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual

2.3.24.13 NdbInterpretedCode::branch_col_le()

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 or equal to the column value. Beginning with NDB 8.0.18, it can also be used to compare two table column values in this fashion.

Signature.  Compare a table column value with a constant:

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

Compare values of two table columns:

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

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

  • 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 or equal to the column value

The method takes the three parameters listed here when used to compare two table column values:

  • 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 or equal to the second

When comparing two table column values, the types of the column values must be exactly the same in all respects.

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