1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

When rewriting a query for window functions, if the rewrite changes the

depth of TK_AGG_FUNCTION nodes, be sure to adjust the Expr.op2 field
appropriately.  Fix for ticket [7a5279a25c57adf1]

FossilOrigin-Name: ad7bb70af9bb68d192137188bb2528f1e9e43ad164c925174ca1dafc9e1f5339
This commit is contained in:
drh
2020-05-24 03:38:37 +00:00
parent e40cc16b47
commit c37577bb2d
5 changed files with 50 additions and 9 deletions

View File

@@ -24,6 +24,8 @@
**
** incrAggFunctionDepth(pExpr,n) is the main routine. incrAggDepth(..)
** is a helper function - a callback for the tree walker.
**
** See also the sqlite3WindowExtraAggFuncDepth() routine in window.c
*/
static int incrAggDepth(Walker *pWalker, Expr *pExpr){
if( pExpr->op==TK_AGG_FUNCTION ) pExpr->op2 += pWalker->u.n;