Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual

2.3.24.9 NdbInterpretedCode::branch_col_eq()

Description.  This method compares a table column value with an arbitrary constant and jumps to the specified program label if the values are equal. In NDB 8.0.18 and later, it can also be used to compare two columns for equality.

Signature.  Compare a column with a value:

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

Compare two columns:

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

Parameters.  When comparing a column and a value, 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 compared values are equal

When comparing two table column values, the parameters required are shown here:

  • 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: Location to jump to if the compared columns are the same. Must already have been defined using def_label()

When using this method to compare two columns, the columns must be of exactly the same type.

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