Skip to main content

in_list_rules

Function in_list_rules 

Source
pub fn in_list_rules(
    operand: &BoundExpr,
    list: &[BoundExpr],
) -> (Option<Affinity>, Collation)
Expand description

Returns the affinity and collation operand IN (list) compares with.

Measured against 3.53.4: the list items are stored under the LEFT operand’s affinity and looked up under the LEFT operand’s collation, so an item’s own affinity (1 IN (CAST('1' AS TEXT), 2) is 0) and column collation ('A' IN (nocase_column, 'x') is 0) do not count, and neither does an explicit COLLATE on an item. The one exception is a list of a single constant item, which SQLite’s parser rewrites to operand = +item: then an explicit COLLATE on the item counts as it does for =, and the unary plus still hides the item’s affinity.

@param operand - the left operand @param list - the bound items between the parentheses