Index: pages/datatype3.in ================================================================== --- pages/datatype3.in +++ pages/datatype3.in @@ -447,15 +447,18 @@ commuted - if expressions of the form "a<40" are rewritten as "40>a".

## 4.0 Operators

-

^(All mathematical operators (which is to say, all operators other -than the concatenation operator "||", LIKE, GLOB, MATCH, and REGEXP) -apply NUMERIC affinity to both operands prior to being carried out.)^ -^If one or both operands cannot be converted to NUMERIC then the result of the -mathematical operation is NULL.

+

^(All mathematical operators (+, -, *, /, %, <<, >>, +&, and |) +cast both operands to the NUMERIC storage class prior to being carried out.)^ +^The cast is carried through even if it is lossy and irreversible. +^A NULL operand on a mathematical operator yields a NULL result. +^(An operand on a mathematical operator that does not look in any way +numeric and is not NULL is converted to 0 or 0.0.)^ +

## 5.0 Sorting, Grouping and Compound SELECTs

^When query results are sorted by an ORDER BY clause, values with storage class NULL come first, followed by INTEGER and REAL values @@ -469,19 +472,13 @@ equal. ^No affinities are applied to any values as the result of a GROUP by clause.

^The compound SELECT operators UNION, INTERSECT and EXCEPT perform implicit comparisons between values. -^Before these comparisons are performed an affinity may be applied to -each value. ^The same affinity, if any, is applied to all values that -may be returned in a single column of the compound SELECT result set. -^The affinity applied is the affinity of the column returned by the -left most component SELECTs that has a column value (and not some -other kind of expression) in that position. ^If for a given compound -SELECT column none of the component SELECTs return a column value, no -affinity is applied to the values from that column before they are -compared.

+^No affinity is applied to comparison operands for the implicit +comparisons associated with UNION, INTERSECT, or EXCEPT - the values +are compared as is.

hd_fragment collation {*collating sequence} \ {collating function} *collation *BINARY *NOCASE *RTRIM \ {BINARY collating function} \ {NOCASE collating function} \