diff options
author | danielk1977 <danielk1977@noemail.net> | 2008-11-12 08:07:12 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2008-11-12 08:07:12 +0000 |
commit | 259a455f711dd279ef3eb52a0b678e084a0cf06f (patch) | |
tree | 24e0fa7f6e0f5fc5604239708a1789a6d82cd936 /src/expr.c | |
parent | 0af3f8935f8990c57347fc6ccf530e6b15176be9 (diff) | |
download | sqlite-259a455f711dd279ef3eb52a0b678e084a0cf06f.tar.gz sqlite-259a455f711dd279ef3eb52a0b678e084a0cf06f.zip |
Make sure affinities and implicit collation sequences are correctly used by comparison expressions in the select-list or having clause of an aggregate query. Ticket #3493. (CVS 5889)
FossilOrigin-Name: b8ceaa00500f29bbbd0cc5aec71a6ffa91ae6b43
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/expr.c b/src/expr.c index ed02f14bb..d0f7f85ff 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.401 2008/11/06 15:33:04 drh Exp $ +** $Id: expr.c,v 1.402 2008/11/12 08:07:12 danielk1977 Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -43,7 +43,9 @@ char sqlite3ExprAffinity(Expr *pExpr){ return sqlite3AffinityType(&pExpr->token); } #endif - if( (op==TK_COLUMN || op==TK_REGISTER) && pExpr->pTab!=0 ){ + if( (op==TK_AGG_COLUMN || op==TK_COLUMN || op==TK_REGISTER) + && pExpr->pTab!=0 + ){ /* op==TK_REGISTER && pExpr->pTab!=0 happens when pExpr was originally ** a TK_COLUMN but was previously evaluated and cached in a register */ int j = pExpr->iColumn; @@ -89,7 +91,7 @@ CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){ pColl = p->pColl; if( pColl ) break; op = p->op; - if( (op==TK_COLUMN || op==TK_REGISTER) && p->pTab!=0 ){ + if( (op==TK_AGG_COLUMN || op==TK_COLUMN || op==TK_REGISTER) && p->pTab!=0 ){ /* op==TK_REGISTER && p->pTab!=0 happens when pExpr was originally ** a TK_COLUMN but was previously evaluated and cached in a register */ const char *zColl; |