From ec41ddac37fc78707d1051c77c8b884caa7c58ff Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 7 Feb 2007 13:09:45 +0000 Subject: [PATCH] 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) FossilOrigin-Name: 3638823a629164e4158f76d03ff2cea1eab34e9d --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/expr.c | 19 +++++++++++++++---- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 0c76024f45..6c00dba6e7 100644 --- 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 diff --git a/manifest.uuid b/manifest.uuid index 7929cab3b4..fee0860a9b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2bd4b62a20219f939ac2ac22440dc7fc0449f766 \ No newline at end of file +3638823a629164e4158f76d03ff2cea1eab34e9d \ No newline at end of file diff --git a/src/expr.c b/src/expr.c index 27bb7b85a5..ced48d851a 100644 --- a/src/expr.c +++ b/src/expr.c @@ -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 @@ -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; } -- 2.47.2