diff options
author | dan <dan@noemail.net> | 2018-06-08 16:11:55 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2018-06-08 16:11:55 +0000 |
commit | dacf1de95c75ffdaf01537a21666a270e29a670c (patch) | |
tree | d306c967bbb97d13af0f864519866055d875e66b /src/expr.c | |
parent | 03854d2eccd79a5538da1ead29ed52dca85d5332 (diff) | |
download | sqlite-dacf1de95c75ffdaf01537a21666a270e29a670c.tar.gz sqlite-dacf1de95c75ffdaf01537a21666a270e29a670c.zip |
Do not flatten sub-queries that contain window functions.
FossilOrigin-Name: 236cb75bd1f0d5eb86aa5f52d8d548e7263c34633833dcea9dfc934f142113b8
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/expr.c b/src/expr.c index 54e9ced00..af4201edf 100644 --- a/src/expr.c +++ b/src/expr.c @@ -1182,24 +1182,6 @@ static int dupedExprSize(Expr *p, int flags){ return nByte; } -static Window *winDup(sqlite3 *db, Window *p){ - Window *pNew = 0; - if( p ){ - pNew = sqlite3DbMallocZero(db, sizeof(Window)); - if( pNew ){ - pNew->pFilter = sqlite3ExprDup(db, p->pFilter, 0); - pNew->pPartition = sqlite3ExprListDup(db, p->pPartition, 0); - pNew->pOrderBy = sqlite3ExprListDup(db, p->pOrderBy, 0); - pNew->eType = p->eType; - pNew->eEnd = p->eEnd; - pNew->eStart = p->eStart; - pNew->pStart = sqlite3ExprDup(db, pNew->pStart, 0); - pNew->pEnd = sqlite3ExprDup(db, pNew->pEnd, 0); - } - } - return pNew; -} - /* ** This function is similar to sqlite3ExprDup(), except that if pzBuffer ** is not NULL then *pzBuffer is assumed to point to a buffer large enough @@ -1289,7 +1271,7 @@ static Expr *exprDup(sqlite3 *db, Expr *p, int dupFlags, u8 **pzBuffer){ if( ExprHasProperty(p, EP_Reduced|EP_TokenOnly) ){ pNew->pWin = 0; }else{ - pNew->pWin = winDup(db, p->pWin); + pNew->pWin = sqlite3WindowDup(db, p->pWin); } if( !ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){ if( pNew->op==TK_SELECT_COLUMN ){ |