Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual

2.3.24.11 NdbInterpretedCode::branch_col_ge()

Description.  This method compares a table column value with an arbitrary constant and jumps to the specified program label if the constant column value. In NDB 8.0.18 and later, it can also be used to compare two columns and perform the jump if the value of the first column is greater than or equal to that of the second.

Signature.  Compare value with column:

int branch_col_ge
    (
      const void* val,
      Uint32 len,
      Uint32 attrId,
      Uint32 label
    )

Compare values of two columns:

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

Parameters.  When used to compare a value with a column, 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 greater than or equal to the column value

The method takes the parameters listed here when used to compare two columns:

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

When comparing two columns, the types of the columns must be exactly the same in all respects.

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