Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual NdbInterpretedCode::branch_col_gt()

Description.  This method compares a table column value with an arbitrary constant and jumps to the specified program label if the constant is greater than the column value. In NDB 8.0.18 and later, this method is overloaded such that it can be used to compare two column values and make the jump if the first is greater than 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 table column, 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 greater than the column value

The method takes the three 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.