aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2018-06-18 20:34:43 +0000
committerdan <dan@noemail.net>2018-06-18 20:34:43 +0000
commitc95f38d45636435b6cdbe4eb72fc5342ee1deceb (patch)
treecaea2e6b16becb7da585b62c1149083844f37dce /src/expr.c
parentf87e10c75ebb107c98ebf441d0cc753ec2442a54 (diff)
downloadsqlite-c95f38d45636435b6cdbe4eb72fc5342ee1deceb.tar.gz
sqlite-c95f38d45636435b6cdbe4eb72fc5342ee1deceb.zip
Fix problems with using window functions in CREATE VIEW statements.
FossilOrigin-Name: 943bccd2a6bd4cf3e0534c1fa46885bfa2ba7b780ddcdff9f1ea4cbb3f04e786
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/expr.c b/src/expr.c
index a5a0b7403..196942673 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1116,7 +1116,7 @@ static int exprStructSize(Expr *p){
** Note that with flags==EXPRDUP_REDUCE, this routines works on full-size
** (unreduced) Expr objects as they or originally constructed by the parser.
** During expression analysis, extra information is computed and moved into
-** later parts of teh Expr object and that extra information might get chopped
+** later parts of the Expr object and that extra information might get chopped
** off if the expression is reduced. Note also that it does not work to
** make an EXPRDUP_REDUCE copy of a reduced expression. It is only legal
** to reduce a pristine expression tree from the parser. The implementation
@@ -1128,7 +1128,7 @@ static int dupedExprStructSize(Expr *p, int flags){
assert( flags==EXPRDUP_REDUCE || flags==0 ); /* Only one flag value allowed */
assert( EXPR_FULLSIZE<=0xfff );
assert( (0xfff & (EP_Reduced|EP_TokenOnly))==0 );
- if( 0==flags || p->op==TK_SELECT_COLUMN ){
+ if( 0==flags || p->op==TK_SELECT_COLUMN || p->pWin ){
nSize = EXPR_FULLSIZE;
}else{
assert( !ExprHasProperty(p, EP_TokenOnly|EP_Reduced) );
@@ -1480,7 +1480,7 @@ Select *sqlite3SelectDup(sqlite3 *db, Select *pDup, int flags){
pNew->nSelectRow = p->nSelectRow;
pNew->pWith = withDup(db, p->pWith);
pNew->pWin = 0;
- pNew->pWinDefn = 0; /* TODO!! */
+ pNew->pWinDefn = sqlite3WindowListDup(db, p->pWinDefn);
sqlite3SelectSetName(pNew, p->zSelName);
*pp = pNew;
pp = &pNew->pPrior;