- C Merge\schanges\sfor\sthe\snew\ssqlite3_win32_set_directory\sAPI\sto\strunk.
- D 2012-08-23T22:45:34.016
-C Add\stest\scases\sand\sfix\sbugs\sassociated\swith\sthe\sprevious\scheck-in\nenhancements\sto\snested\saggregate\ssubquery\sprocessing.
-D 2012-08-23T19:46:11.832
++C Merge\sthe\snested\saggregate\squery\senhancements\sinto\strunk.
++D 2012-08-24T01:07:52.214
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in abd5c10d21d1395f140d9e50ea999df8fa4d6376
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/ctime.c 500d019da966631ad957c37705642be87524463b
F src/date.c 067a81c9942c497aafd2c260e13add8a7d0c7dd4
F src/delete.c 4c20ea4f6213b3bc1c6a510586864b679946e05e
- F src/expr.c e2927abf9c69ce4ff9a931bd201946961c34819a
-F src/expr.c 94bac8cc555d97fe4518529ad53d9ba926df9d62
++F src/expr.c 217840a107dcc1e5dbb57cea311daad04bedbb9a
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
F src/fkey.c 657212460bf5cfd3ae607d12ea62092844c227b5
F src/func.c 18dfedfb857e100b05755a1b12e88b389f957879
F src/prepare.c 33291b83cca285718048d219c67b8298501fa3a5
F src/printf.c 4a9f882f1c1787a8b494a2987765acf9d97ac21f
F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50
- F src/resolve.c b3c70ab28cac60de33684c9aa9e5138dcf71d6dd
+ F src/resolve.c 9e28280ec98035f31900fdd1db01f86f68ca6c32
F src/rowset.c f6a49f3e9579428024662f6e2931832511f831a1
- F src/select.c a365da6d7a6d7d8a10ad60ca71837ab5e9369466
-F src/select.c cd051b460e7d0c3ac42e7727eef075fb29c23769
++F src/select.c 2c0291db072924cace54aadbff1996297e9b8de0
F src/shell.c 076e1c90d594644f36027c8ecff9a392cf2d3a06
F src/sqlite.h.in f664797c68ced43c2ea2c541d4ec8e1e04ec68ac
F src/sqlite3ext.h 6904f4aadf976f95241311fbffb00823075d9477
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
F tool/win/sqlite.vsix 67d8a99aceb56384a81b3f30d6c71743146d2cc9
- P b1dbf490869d7fc55ce797cf80cf3bf7141d2d15 1246f15b146ebf6518fb8f5c92a1ebc9495cd9dc
- R 35479bceaf9a1b66b4c629b32ba58687
- U mistachkin
- Z e3d10f82918ee1a10410c8802031890d
-P 3c3ffa901f5ce8a523028ff15563ce3e0f55a641
-R 7ac9abcbd2554a39d90c74812c59041d
++P 20f184f2d5908badd9d44d4fe2ad7c9e182c8803 00b1dc71be4c3420730b5f7840af824ea86165e7
++R c1fab8e17aa8935c76d7626b4d7fe139
+ U drh
-Z 5534967a0ee04b7aa372747f5ce8ed30
++Z 3e9a3890be18a0a197379668b716e1a3
}
/*
- ** This is the expression callback for sqlite3FunctionUsesOtherSrc().
- **
- ** Determine if an expression references any table other than one of the
- ** tables in pWalker->u.pSrcList and abort if it does.
+ ** An instance of the following structure is used by the tree walker
+ ** to count references to table columns in the arguments of an
+ ** aggregate function, in order to implement the
+ ** sqlite3FunctionThisSrc() routine.
+ */
+ struct SrcCount {
+ SrcList *pSrc; /* One particular FROM clause in a nested query */
+ int nThis; /* Number of references to columns in pSrcList */
+ int nOther; /* Number of references to columns in other FROM clauses */
+ };
+
+ /*
+ ** Count the number of references to columns.
*/
- static int exprUsesOtherSrc(Walker *pWalker, Expr *pExpr){
- if( pExpr->op==TK_COLUMN || pExpr->op==TK_AGG_COLUMN ){
+ static int exprSrcCount(Walker *pWalker, Expr *pExpr){
- if( pExpr->op==TK_COLUMN || pExpr->op==TK_AGG_COLUMN ){
++ /* The NEVER() on the second term is because sqlite3FunctionUsesThisSrc()
++ ** is always called before sqlite3ExprAnalyzeAggregates() and so the
++ ** TK_COLUMNs have not yet been converted into TK_AGG_COLUMN. If
++ ** sqlite3FunctionUsesThisSrc() is used differently in the future, the
++ ** NEVER() will need to be removed. */
++ if( pExpr->op==TK_COLUMN || NEVER(pExpr->op==TK_AGG_COLUMN) ){
int i;
- SrcList *pSrc = pWalker->u.pSrcList;
+ struct SrcCount *p = pWalker->u.pSrcCount;
+ SrcList *pSrc = p->pSrc;
for(i=0; i<pSrc->nSrc; i++){
- if( pExpr->iTable==pSrc->a[i].iCursor ) return WRC_Continue;
+ if( pExpr->iTable==pSrc->a[i].iCursor ) break;
+ }
+ if( i<pSrc->nSrc ){
+ p->nThis++;
+ }else{
+ p->nOther++;
}
- return WRC_Abort;
- }else{
- return WRC_Continue;
}
+ return WRC_Continue;
}
/*