/ Check-in [3638823a]
Login

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

Overview
Comment:Explicit collations always override implicit collations. This is backwards compatible since SQLite has not previously supported explicit collations. Need to add tests of this new behavior. (CVS 3633)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3638823a629164e4158f76d03ff2cea1eab34e9d
User & Date: drh 2007-02-07 13:09:46
Context
2007-02-10
19:22
Changes to support fragmentation analysis in sqlite3_analyzer. (CVS 3634) check-in: bd6bc3b8 user: drh tags: trunk
2007-02-07
13:09
Explicit collations always override implicit collations. This is backwards compatible since SQLite has not previously supported explicit collations. Need to add tests of this new behavior. (CVS 3633) check-in: 3638823a user: drh tags: trunk
01:06
Change the coding of PRAGMA count_changes so that it uses memory cells of the VM rather than the stack, to avoid problems with leftovers on the stack interfering with other operations. Ticket #2217. (CVS 3632) check-in: 2bd4b62a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains routines used for analyzing expressions and
    13     13   ** for generating VDBE code that evaluates expressions in SQLite.
    14     14   **
    15         -** $Id: expr.c,v 1.274 2007/02/02 12:44:37 drh Exp $
           15  +** $Id: expr.c,v 1.275 2007/02/07 13:09:46 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <ctype.h>
    19     19   
    20     20   /*
    21     21   ** Return the 'affinity' of the expression pExpr if any.
    22     22   **
................................................................................
   172    172   **
   173    173   ** If the left hand expression has a collating sequence type, then it is
   174    174   ** used. Otherwise the collation sequence for the right hand expression
   175    175   ** is used, or the default (BINARY) if neither expression has a collating
   176    176   ** type.
   177    177   */
   178    178   static CollSeq* binaryCompareCollSeq(Parse *pParse, Expr *pLeft, Expr *pRight){
   179         -  CollSeq *pColl = sqlite3ExprCollSeq(pParse, pLeft);
   180         -  if( !pColl ){
   181         -    pColl = sqlite3ExprCollSeq(pParse, pRight);
          179  +  CollSeq *pColl;
          180  +  assert( pLeft );
          181  +  assert( pRight );
          182  +  if( pLeft->flags & EP_ExpCollate ){
          183  +    assert( pLeft->pColl );
          184  +    pColl = pLeft->pColl;
          185  +  }else if( pRight->flags & EP_ExpCollate ){
          186  +    assert( pRight->pColl );
          187  +    pColl = pRight->pColl;
          188  +  }else{
          189  +    pColl = sqlite3ExprCollSeq(pParse, pLeft);
          190  +    if( !pColl ){
          191  +      pColl = sqlite3ExprCollSeq(pParse, pRight);
          192  +    }
   182    193     }
   183    194     return pColl;
   184    195   }
   185    196   
   186    197   /*
   187    198   ** Generate code for a comparison operator.
   188    199   */