Comparison Operators

[This is preliminary documentation and subject to change.]

DBOP_is_NULL, DBOP_is_NOT_NULL
Comparison to NULL value. Both operators are needed, since "NOT is_NULL" and "is_NOT_NULL" differ in SQL if the operand is a row with some (but not all) NULL values. One scalar input, Boolean result.
DBOP_equal, DBOP_not_equal, DBOP_less, DBOP_less_equal, DBOP_greater, DBOP_greater_equal, DBOP_equal_all, DBOP_not_equal_all, DBOP_less_all, DBOP_less_equal_all, DBOP_greater_all, DBOP_greater_equal_all, DBOP_equal_any, DBOP_not_equal_any, DBOP_less_any, DBOP_less_equal_any, DBOP_greater_any, DBOP_greater_equal_any
Comparison operators with semantics as in SQL. For the normal comparison operators, the two inputs rows must both be scalars, or both be rows. Otherwise, the scalar is converted into a one-column row as necessary. The "_all" and "_any" operators require a scalar left input and a table-valued right input, where a column value in a chaptered column is a special case of a table. Boolean output.

Row-valued comparison refers to the comparison between two row instances. Multi-valued comparison refers to the comparison between a row instance and a table (i.e., _all, any operators). The rules for row-valued comparisons are based on ANSI SQL semantics. The rules for multi-valued comparisons are an extension of the rule-valued ones.

The weight of this node is stored as a DBVALUEKIND_I4 in the value.lValue field.

DBOP_anybits, DBOP_allbits, DBOP_anybits_any, DBOP_allbits_any, DBOP_anybits_all, DBOP_allbits_all
These operators are exactly like other comparison operators in terms of syntax: they take two inputs, the first being a column, the second being a scalar value to compare with the column. The specific semantics of these nodes are as follows. DBOP_any_bits is true if the column value bitwise-ANDed with the constant is non-zero. DBOP_all_bits is true if the column value bitwise-ANDed with the constant equals the constant. There are also "_any" and "_all" versions of these nodes, as with other comparison operators.

The weight of this node is stored as a DBVALUEKIND_I4 in the value.lValue field.

DBOP_between, DBOP_between_unordered
SQL comparison operations. "Between_unordered" first sorts the bounding values; "a between_unordered b and c" is equivalent to "a >= min (b, c) and a <= max (b, c)", whereas "a between b and c" is equivalent to "a >= b and a <= c." All variants of "between" are inclusive, meaning that a value equal to one of the end-points is acceptable. There is no exclusive "between" variant. Three scalar inputs (which may be rows), Boolean result.
DBOP_match, DBOP_match_unique, DBOP_match_partial, DBOP_match_partial_unique, DBOP_match_full, DBOP_match_full_unique
SQL's match predicate. Two scalar inputs (which may be rows), Boolean output.
DBOP_and, DBOP_or, DBOP_xor, DBOP_equivalent
These Boolean operators representing the logical AND, OR, exclusive OR, and equivalence, take two or more Boolean inputs (except DBOP_equivalent which takes exactly two), and produce a Boolean result. The weight of this node is stored as a DBVALUEKIND_I4 in the value.lValue field.
DBOP_not
One Boolean input, Boolean result. The weight of this node is stored as a DBVALUEKIND_I4 in the value.lValue field.
DBOP_implies

This operator represents Boolean implication. It takes two mandatory inputs of type Boolean and produces a Boolean output according to the following table:
Input1 Input2 Result
False False True
False True True
True False False
True True True