mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Evaluate multiple window functions in a single pass if they use the same
window definition. Add xValue callbacks for other built-in aggregate functions. FossilOrigin-Name: c9f0f140941660ff368e5bb5752d54feb1964b7a9eac986d4bfb8f24a1c20d86
This commit is contained in:
@@ -776,13 +776,15 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|
||||
sqlite3WalkExprList(pWalker, pList);
|
||||
if( is_agg ){
|
||||
if( pExpr->pWin ){
|
||||
pExpr->pWin->pNextWin = pNC->pWin;
|
||||
pNC->pWin = pExpr->pWin;
|
||||
if( 0==pNC->pWin
|
||||
|| 0==sqlite3WindowCompare(pParse, pNC->pWin, pExpr->pWin)
|
||||
){
|
||||
pExpr->pWin->pNextWin = pNC->pWin;
|
||||
pNC->pWin = pExpr->pWin;
|
||||
}
|
||||
pExpr->pWin->pFunc = pDef;
|
||||
pExpr->pWin->nArg = pExpr->x.pList->nExpr;
|
||||
}
|
||||
else
|
||||
{
|
||||
pExpr->pWin->nArg = (pExpr->x.pList ? pExpr->x.pList->nExpr : 0);
|
||||
}else{
|
||||
NameContext *pNC2 = pNC;
|
||||
pExpr->op = TK_AGG_FUNCTION;
|
||||
pExpr->op2 = 0;
|
||||
|
||||
Reference in New Issue
Block a user