aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2012-05-22 13:01:39 +0000
committerdrh <drh@noemail.net>2012-05-22 13:01:39 +0000
commite56467fc9ffdf634b939c33886e6513fc27376c3 (patch)
tree0c81cbc3359f436a9b22bb80f91021b37e0e24f7 /src/select.c
parent7b9370a445ad58213953264377be9124ef01c127 (diff)
parent3773b29167a13af8c8cb1cef14dda5772f0a2232 (diff)
downloadsqlite-e56467fc9ffdf634b939c33886e6513fc27376c3.tar.gz
sqlite-e56467fc9ffdf634b939c33886e6513fc27376c3.zip
Version 3.7.12.1
FossilOrigin-Name: d07b7b67d1b3bf65cfe8d96d45a7f1d387bea7ce
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/select.c b/src/select.c
index 835d9fd9c..d79a6112f 100644
--- a/src/select.c
+++ b/src/select.c
@@ -3149,6 +3149,7 @@ static Table *isSimpleCount(Select *p, AggInfo *pAggInfo){
if( IsVirtual(pTab) ) return 0;
if( pExpr->op!=TK_AGG_FUNCTION ) return 0;
+ if( pAggInfo->nFunc==0 ) return 0;
if( (pAggInfo->aFunc[0].pFunc->flags&SQLITE_FUNC_COUNT)==0 ) return 0;
if( pExpr->flags&EP_Distinct ) return 0;
@@ -4139,7 +4140,9 @@ int sqlite3Select(
sAggInfo.nAccumulator = sAggInfo.nColumn;
for(i=0; i<sAggInfo.nFunc; i++){
assert( !ExprHasProperty(sAggInfo.aFunc[i].pExpr, EP_xIsSelect) );
+ sNC.ncFlags |= NC_InAggFunc;
sqlite3ExprAnalyzeAggList(&sNC, sAggInfo.aFunc[i].pExpr->x.pList);
+ sNC.ncFlags &= ~NC_InAggFunc;
}
if( db->mallocFailed ) goto select_end;