]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Explicit collations always override implicit collations. This is
authordrh <drh@noemail.net>
Wed, 7 Feb 2007 13:09:45 +0000 (13:09 +0000)
committerdrh <drh@noemail.net>
Wed, 7 Feb 2007 13:09:45 +0000 (13:09 +0000)
backwards compatible since SQLite has not previously supported
explicit collations. Need to add tests of this new behavior. (CVS 3633)

FossilOrigin-Name: 3638823a629164e4158f76d03ff2cea1eab34e9d

manifest
manifest.uuid
src/expr.c

index 0c76024f45e3a84f4c2ad8bf20e3b0a0dc0ea85f..6c00dba6e7f6cdeae1e5c5edcdb8610f6f22d201 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Change\sthe\scoding\sof\sPRAGMA\scount_changes\sso\sthat\sit\suses\smemory\scells\nof\sthe\sVM\srather\sthan\sthe\sstack,\sto\savoid\sproblems\swith\sleftovers\son\sthe\nstack\sinterfering\swith\sother\soperations.\s\sTicket\s#2217.\s(CVS\s3632)
-D 2007-02-07T01:06:53
+C Explicit\scollations\salways\soverride\simplicit\scollations.\s\sThis\sis\nbackwards\scompatible\ssince\sSQLite\shas\snot\spreviously\ssupported\nexplicit\scollations.\sNeed\sto\sadd\stests\sof\sthis\snew\sbehavior.\s(CVS\s3633)
+D 2007-02-07T13:09:46
 F Makefile.in 7fa74bf4359aa899da5586e394d17735f221315f
 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -65,7 +65,7 @@ F src/complete.c 7d1a44be8f37de125fcafd3d3a018690b3799675
 F src/date.c 393c73fc027597e008dcd81454544659e978b05c
 F src/delete.c 151d08386bf9c9e7f92f6b9106c71efec2def184
 F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b
-F src/expr.c 8cf28815fd3207ca99b5d755b1c8b662c263b29b
+F src/expr.c dfd25ae8f8f2ebf3d8dea605a5cea959946aabb7
 F src/func.c b7e1e220a6795ecae7649815145ea5f8644dfa5f
 F src/hash.c 449f3d6620193aa557f5d86cbc5cc6b87702b185
 F src/hash.h 1b3f7e2609141fd571f62199fc38687d262e9564
@@ -431,7 +431,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P 283385d20724f0144f38de89bd179715ee5e738b
-R 5393121f9f6ea7c588d140b3d91538be
+P 2bd4b62a20219f939ac2ac22440dc7fc0449f766
+R 7101481de1358da4b073980f7790ac38
 U drh
-Z f104f701ef9aaf65b7572ce40741f8c1
+Z 02cb54f9b44027c71a4480afa634e551
index 7929cab3b4ae756705aba4510b8fd84d40bdd11c..fee0860a9b2a27638fce1a4973863669cbb59aa3 100644 (file)
@@ -1 +1 @@
-2bd4b62a20219f939ac2ac22440dc7fc0449f766
\ No newline at end of file
+3638823a629164e4158f76d03ff2cea1eab34e9d
\ No newline at end of file
index 27bb7b85a521b1b1234f7ba986f76b5d87123881..ced48d851a1a2f4c09eda8a648f12216f883f24d 100644 (file)
@@ -12,7 +12,7 @@
 ** This file contains routines used for analyzing expressions and
 ** for generating VDBE code that evaluates expressions in SQLite.
 **
-** $Id: expr.c,v 1.274 2007/02/02 12:44:37 drh Exp $
+** $Id: expr.c,v 1.275 2007/02/07 13:09:46 drh Exp $
 */
 #include "sqliteInt.h"
 #include <ctype.h>
@@ -176,9 +176,20 @@ static int binaryCompareP1(Expr *pExpr1, Expr *pExpr2, int jumpIfNull){
 ** type.
 */
 static CollSeq* binaryCompareCollSeq(Parse *pParse, Expr *pLeft, Expr *pRight){
-  CollSeq *pColl = sqlite3ExprCollSeq(pParse, pLeft);
-  if( !pColl ){
-    pColl = sqlite3ExprCollSeq(pParse, pRight);
+  CollSeq *pColl;
+  assert( pLeft );
+  assert( pRight );
+  if( pLeft->flags & EP_ExpCollate ){
+    assert( pLeft->pColl );
+    pColl = pLeft->pColl;
+  }else if( pRight->flags & EP_ExpCollate ){
+    assert( pRight->pColl );
+    pColl = pRight->pColl;
+  }else{
+    pColl = sqlite3ExprCollSeq(pParse, pLeft);
+    if( !pColl ){
+      pColl = sqlite3ExprCollSeq(pParse, pRight);
+    }
   }
   return pColl;
 }