1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Candidate fix for the nested aggregate query problem of ticket

[c2ad16f997ee9c8e].

FossilOrigin-Name: f3dd1fafd4718558de1f06139419a8c560d727f5
This commit is contained in:
drh
2012-05-21 20:13:39 +00:00
parent a51009b251
commit 3a8c4be7d4
6 changed files with 55 additions and 15 deletions

View File

@@ -3965,7 +3965,9 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
return WRC_Prune;
}
case TK_AGG_FUNCTION: {
if( !sqlite3FunctionUsesOtherSrc(pExpr, pSrcList) ){
if( (pNC->ncFlags & NC_InAggFunc)==0
&& !sqlite3FunctionUsesOtherSrc(pExpr, pSrcList)
){
/* Check to see if pExpr is a duplicate of another aggregate
** function that is already in the pAggInfo structure
*/
@@ -4002,8 +4004,8 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
ExprSetIrreducible(pExpr);
pExpr->iAgg = (i16)i;
pExpr->pAggInfo = pAggInfo;
return WRC_Prune;
}
return WRC_Prune;
}
}
return WRC_Continue;