/ Check-in [4692a85e]
Login

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

Overview
Comment:Clarifications to the datatype3.html document. (CVS 3657)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4692a85edbe27d512f1830b8fb3e2b05b92a0cb5
User & Date: drh 2007-02-23 14:20:38
Context
2007-02-23
23:13
Disable the OR optimization if it would conflict with column affinity coercions. Ticket #2249. Additional cleanup and testing of the OR optimization. (CVS 3658) check-in: 908daaa9 user: drh tags: trunk
14:20
Clarifications to the datatype3.html document. (CVS 3657) check-in: 4692a85e user: drh tags: trunk
03:00
Clarify the documentation on how comparisons occur in an IN operator. Fix the comparison operators when both sides of an IN operator are expressions (ticket #2248). Changes to main.mk for adding FTS2 into the standard build also got mixed in with this check-in by mistake. (CVS 3656) check-in: da81725c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to www/datatype3.tcl.

     1         -set rcsid {$Id: datatype3.tcl,v 1.15 2007/02/23 03:00:46 drh Exp $}
            1  +set rcsid {$Id: datatype3.tcl,v 1.16 2007/02/23 14:20:38 drh Exp $}
     2      2   source common.tcl
     3      3   header {Datatypes In SQLite Version 3}
     4      4   puts {
     5      5   <h2>Datatypes In SQLite Version 3</h2>
     6      6   
     7      7   <h3>1. Storage Classes</h3>
     8      8   
................................................................................
   163    163   
   164    164   -- Storage classes for the following row:
   165    165   -- TEXT, REAL, INTEGER, REAL
   166    166   INSERT INTO t1 VALUES(500.0, 500.0, 500.0, 500.0);
   167    167   </PRE>
   168    168   </blockquote>
   169    169   
          170  +<a name="comparisons">
   170    171   <h3>3. Comparison Expressions</h3>
   171    172   
   172    173   <P>Like SQLite version 2, version 3
   173    174   features the binary comparison operators '=',
   174    175   '&lt;', '&lt;=', '&gt;=' and '!=', an operation to test for set
   175    176   membership, 'IN', and the ternary comparison operator 'BETWEEN'.</P>
   176    177   <P>The results of a comparison depend on the storage classes of the
................................................................................
   192    193   	determined using memcmp().</P>
   193    194   </UL>
   194    195   
   195    196   <P>SQLite may attempt to convert values between the numeric storage
   196    197   classes (INTEGER and REAL) and TEXT before performing a comparison.
   197    198   For binary comparisons, this is done in the cases enumerated below.
   198    199   The term "expression" used in the bullet points below means any
   199         -SQL scalar expression or literal other than a column value.</P>
          200  +SQL scalar expression or literal other than a column value.  Note that
          201  +if X and Y.Z are a column names, then +X and +Y.Z are considered
          202  +expressions.</P>
   200    203   <UL>
   201    204   	<LI><P>When a column value is compared to the result of an
   202    205   	expression, the affinity of the column is applied to the result of
   203    206   	the expression before the comparison takes place.</P>
   204    207   
   205    208   	<LI><P>When two column values are compared, if one column has
   206         -	INTEGER or NUMERIC affinity and the other does not, the NUMERIC
   207         -	affinity is applied to any values with storage class TEXT extracted
   208         -	from the non-NUMERIC column.</P>
          209  +	INTEGER or REAL or NUMERIC affinity and the other does not, 
          210  +        then NUMERIC affinity is applied to any values with storage
          211  +        class TEXT extracted from the non-NUMERIC column.</P>
   209    212   
   210    213   	<LI><P>When the results of two expressions are compared, no
   211    214           conversions occur.  The results are compared as is.  If a string
   212    215           is compared to a number, the number will always be less than the
   213    216           string.</P>
   214    217   </UL>
   215    218