1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Fix a problem with window functions in aggregate queries that do not have GROUP BY clauses.

FossilOrigin-Name: 99609786f485653464d1caef1d207ae299d28c925bff3e8e94891759b4765dcc
This commit is contained in:
dan
2019-12-27 16:25:56 +00:00
parent d8d2fb9222
commit 431704375e
4 changed files with 57 additions and 14 deletions

View File

@@ -799,6 +799,7 @@ static int selectWindowRewriteExprCb(Walker *pWalker, Expr *pExpr){
}
if( iCol<0 ){
Expr *pDup = sqlite3ExprDup(pParse->db, pExpr, 0);
if( pDup && pDup->op==TK_AGG_FUNCTION ) pDup->op = TK_FUNCTION;
p->pSub = sqlite3ExprListAppend(pParse, p->pSub, pDup);
}
if( p->pSub ){