mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
When translating arguments of aggregate functions into references to
expression indexes, make sure to only translate them for the current aggregate when there are nested aggregates. [forum/forumpost/409ebc7368|Forum post 409ebc7368]. FossilOrigin-Name: 898bfa1afd8260eaaf2aa6db94e74d99ebf4e8a6dc02cf21d20cd981393609a5
This commit is contained in:
@@ -6485,7 +6485,7 @@ static int aggregateIdxEprRefToColCallback(Walker *pWalker, Expr *pExpr){
|
||||
if( pExpr->op==TK_AGG_FUNCTION ) return WRC_Continue;
|
||||
if( pExpr->op==TK_IF_NULL_ROW ) return WRC_Continue;
|
||||
pAggInfo = pExpr->pAggInfo;
|
||||
if( pExpr->iAgg>=pAggInfo->nColumn ) return WRC_Continue;
|
||||
if( NEVER(pExpr->iAgg>=pAggInfo->nColumn) ) return WRC_Continue;
|
||||
assert( pExpr->iAgg>=0 );
|
||||
pCol = &pAggInfo->aCol[pExpr->iAgg];
|
||||
pExpr->op = TK_AGG_COLUMN;
|
||||
|
||||
Reference in New Issue
Block a user