Clarify the relationship between a Window object and its associated Expr.
FossilOrigin-Name: 0cd55e98a478740032f5569ddc00fa5b0e063e90db6e00ac7598c9b7c2fffeee
diff --git a/src/expr.c b/src/expr.c
index 819a14b..9431c4c 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1271,7 +1271,7 @@
if( ExprHasProperty(p, EP_Reduced|EP_TokenOnly) ){
pNew->pWin = 0;
}else{
- pNew->pWin = sqlite3WindowDup(db, p->pWin);
+ pNew->pWin = sqlite3WindowDup(db, pNew, p->pWin);
}
if( !ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){
if( pNew->op==TK_SELECT_COLUMN ){