aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2019-12-27 20:06:32 +0000
committerdan <dan@noemail.net>2019-12-27 20:06:32 +0000
commitb4b36306576fcc053f3e7f9fcfd990340bdb96e8 (patch)
tree6b5a33219b7f656d42643cca0c0330c5732ef054 /src/expr.c
parente3735bf466b8220d126ae7be4b4fc3482a997fdd (diff)
downloadsqlite-b4b36306576fcc053f3e7f9fcfd990340bdb96e8.tar.gz
sqlite-b4b36306576fcc053f3e7f9fcfd990340bdb96e8.zip
Remove a NEVER() that is no longer true. Fix for [36ffedcb9].
FossilOrigin-Name: 597896ed0ae9e2960a8f39576bd7f77a11dccc1da84b6a44ebb5c38d90ebc330
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/expr.c b/src/expr.c
index 92786732f..a5f9a43af 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -5449,12 +5449,13 @@ struct SrcCount {
** Count the number of references to columns.
*/
static int exprSrcCount(Walker *pWalker, Expr *pExpr){
- /* The NEVER() on the second term is because sqlite3FunctionUsesThisSrc()
- ** is always called before sqlite3ExprAnalyzeAggregates() and so the
- ** TK_COLUMNs have not yet been converted into TK_AGG_COLUMN. If
- ** sqlite3FunctionUsesThisSrc() is used differently in the future, the
- ** NEVER() will need to be removed. */
- if( pExpr->op==TK_COLUMN || NEVER(pExpr->op==TK_AGG_COLUMN) ){
+ /* There was once a NEVER() on the second term on the grounds that
+ ** sqlite3FunctionUsesThisSrc() was always called before
+ ** sqlite3ExprAnalyzeAggregates() and so the TK_COLUMNs have not yet
+ ** been converted into TK_AGG_COLUMN. But this is no longer true due
+ ** to window functions - sqlite3WindowRewrite() may now indirectly call
+ ** FunctionUsesThisSrc() when creating a new sub-select. */
+ if( pExpr->op==TK_COLUMN || pExpr->op==TK_AGG_COLUMN ){
int i;
struct SrcCount *p = pWalker->u.pSrcCount;
SrcList *pSrc = p->pSrc;