1
0
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:
dan
2018-05-17 19:24:08 +00:00
parent 2e362f9775
commit e2f781b9d1
9 changed files with 173 additions and 87 deletions

View File

@@ -1286,7 +1286,11 @@ static Expr *exprDup(sqlite3 *db, Expr *p, int dupFlags, u8 **pzBuffer){
*pzBuffer = zAlloc;
}
}else{
pNew->pWin = winDup(db, p->pWin);
if( ExprHasProperty(p, EP_Reduced|EP_TokenOnly) ){
pNew->pWin = 0;
}else{
pNew->pWin = winDup(db, p->pWin);
}
if( !ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){
if( pNew->op==TK_SELECT_COLUMN ){
pNew->pLeft = p->pLeft;