Documentation Source Text

Check-in [6fe30b1e8d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix incorrect documentation concerning affinity of UNION, INTERSECT, and EXCEPT.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6fe30b1e8dcac1e2b9f3494f49d02e3222fd69fa
User & Date: drh 2009-12-31 18:30:39
Context
2009-12-31
22:14
Add the "any" column to the requirement matrix summary screen. The box goes green if all requirements are covered by any combination of TCL, TH3, our source code evidence. check-in: 1c49dd8699 user: drh tags: trunk
18:30
Fix incorrect documentation concerning affinity of UNION, INTERSECT, and EXCEPT. check-in: 6fe30b1e8d user: drh tags: trunk
16:06
Add HTML escapes back into requirement text when generating HTML in the requirements matrix. check-in: ca108712a2 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to pages/datatype3.in.

   445    445   
   446    446   <p>^All of the result in the example are the same if the comparisons are
   447    447   commuted - if expressions of the form "a&lt;40" are rewritten
   448    448   as "40&gt;a".
   449    449   
   450    450   <h2>4.0 Operators</h2>
   451    451   
   452         -<p>^(All mathematical operators (which is to say, all operators other
   453         -than the concatenation operator "||", LIKE, GLOB, MATCH, and REGEXP) 
   454         -apply NUMERIC affinity to both operands prior to being carried out.)^ 
   455         -^If one or both operands cannot be converted to NUMERIC then the result of the
   456         -mathematical operation is NULL.</p>
          452  +<p>^(All mathematical operators (+, -, *, /, %, &lt;&lt;, &gt;&gt;,
          453  +&amp;, and |)
          454  +cast both operands to the NUMERIC storage class prior to being carried out.)^
          455  +^The cast is carried through even if it is lossy and irreversible.
          456  +^A NULL operand on a mathematical operator yields a NULL result.
          457  +^(An operand on a mathematical operator that does not look in any way
          458  +numeric and is not NULL is converted to 0 or 0.0.)^
          459  +</p>
   457    460   
   458    461   <h2>5.0 Sorting, Grouping and Compound SELECTs</h2>
   459    462   
   460    463   <p>^When query results are sorted by an ORDER BY clause, values with storage
   461    464   class NULL come first, followed by INTEGER and REAL values
   462    465   interspersed in numeric order, followed by TEXT values in collating
   463    466   sequence order, and finally BLOB values in memcmp() order.  ^No storage
................................................................................
   467    470   different storage classes are considered distinct, except for INTEGER
   468    471   and REAL values which are considered equal if they are numerically
   469    472   equal. ^No affinities are applied to any values as the result of a
   470    473   GROUP by clause.</p>
   471    474   
   472    475   <p>^The compound SELECT operators UNION,
   473    476   INTERSECT and EXCEPT perform implicit comparisons between values.
   474         -^Before these comparisons are performed an affinity may be applied to
   475         -each value. ^The same affinity, if any, is applied to all values that
   476         -may be returned in a single column of the compound SELECT result set.
   477         -^The affinity applied is the affinity of the column returned by the
   478         -left most component SELECTs that has a column value (and not some
   479         -other kind of expression) in that position. ^If for a given compound
   480         -SELECT column none of the component SELECTs return a column value, no
   481         -affinity is applied to the values from that column before they are
   482         -compared.</p>
          477  +^No affinity is applied to comparison operands for the implicit
          478  +comparisons associated with UNION, INTERSECT, or EXCEPT - the values
          479  +are compared as is.</p>
   483    480   
   484    481   <tcl>hd_fragment collation {*collating sequence} \
   485    482                    {collating function} *collation *BINARY *NOCASE *RTRIM \
   486    483           {BINARY collating function} \
   487    484           {NOCASE collating function} \
   488    485           {RTRIM collating function}</tcl>
   489    486   <h2>6.0 Collating Sequences</h2>