diff options
author | drh <drh@noemail.net> | 2018-07-10 07:39:23 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2018-07-10 07:39:23 +0000 |
commit | eee08611555199aa56aa99f30e0033a124fd9ff7 (patch) | |
tree | 246b7a92cb3d95dc4e347fff9dc4c55f54aadb7c /src | |
parent | 38630ae1de36db73c4610348592bf616ac116529 (diff) | |
download | sqlite-eee08611555199aa56aa99f30e0033a124fd9ff7.tar.gz sqlite-eee08611555199aa56aa99f30e0033a124fd9ff7.zip |
Fix a harmless warning about comment formatting in the previous
check-in. Simplify the ORDER BY dereferencing logic so that it avoids
unreachable branches.
FossilOrigin-Name: 0f6ec605e131ab3d53b9df32af0a3207146a9abbd22dcabd6ef050b92f96735d
Diffstat (limited to 'src')
-rw-r--r-- | src/expr.c | 2 | ||||
-rw-r--r-- | src/resolve.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/expr.c b/src/expr.c index a329ef413..e6df332fb 100644 --- a/src/expr.c +++ b/src/expr.c @@ -4953,7 +4953,7 @@ int sqlite3ExprCompare(Parse *pParse, Expr *pA, Expr *pB, int iTab){ } #ifndef SQLITE_OMIT_WINDOWFUNC /* Justification for the assert(): - /* window functions have p->op==TK_FUNCTION but aggregate functions + ** window functions have p->op==TK_FUNCTION but aggregate functions ** have p->op==TK_AGG_FUNCTION. So any comparison between an aggregate ** function and a window function should have failed before reaching ** this point. And, it is not possible to have a window function and 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; } } } |