diff options
Diffstat (limited to 'src/resolve.c')
-rw-r--r-- | src/resolve.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/resolve.c b/src/resolve.c index 13deeca92..5c1dd09be 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -1245,11 +1245,13 @@ static int resolveOrderGroupBy( if( sqlite3ExprCompare(0, pE, pSelect->pEList->a[j].pExpr, -1)==0 ){ #ifndef SQLITE_OMIT_WINDOWFUNC if( pE->pWin ){ + /* Since this window function is being changed into a reference + ** to the same window function the result set, remove the instance + ** of this window function from the Select.pWin list. */ Window **pp; for(pp=&pSelect->pWin; *pp; pp=&(*pp)->pNextWin){ if( *pp==pE->pWin ){ *pp = (*pp)->pNextWin; - break; } } } |