mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Fix the sqlite3ReferencesSrcList() routine so that it recognizes columns
in the ORDER BY clause of an aggregate. Fixes a problem with [634286828dad873d] discoverd by dbsqlfuzz. FossilOrigin-Name: 3d26f1aaa4876f21f2c3abf13bbc37933c8f32471153e29019880cc9530cb011
This commit is contained in:
@@ -6466,6 +6466,12 @@ int sqlite3ReferencesSrcList(Parse *pParse, Expr *pExpr, SrcList *pSrcList){
|
||||
assert( pExpr->op==TK_AGG_FUNCTION );
|
||||
assert( ExprUseXList(pExpr) );
|
||||
sqlite3WalkExprList(&w, pExpr->x.pList);
|
||||
if( pExpr->pLeft ){
|
||||
assert( pExpr->pLeft->op==TK_ORDER );
|
||||
assert( ExprUseXList(pExpr->pLeft) );
|
||||
assert( pExpr->pLeft->x.pList!=0 );
|
||||
sqlite3WalkExprList(&w, pExpr->pLeft->x.pList);
|
||||
}
|
||||
#ifndef SQLITE_OMIT_WINDOWFUNC
|
||||
if( ExprHasProperty(pExpr, EP_WinFunc) ){
|
||||
sqlite3WalkExpr(&w, pExpr->y.pWin->pFilter);
|
||||
|
Reference in New Issue
Block a user