mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Make sure all terms of the ORDER BY within an aggregate go through aggregate
analysis. Do not attach an aggregate ORDER BY to a window function. FossilOrigin-Name: 16f3805514a741405f70e0ee3b5a6b67720bc75719372e82daa4136fe411ea2b
This commit is contained in:
@@ -6490,8 +6490,14 @@ static void analyzeAggFuncArgs(
|
||||
pNC->ncFlags |= NC_InAggFunc;
|
||||
for(i=0; i<pAggInfo->nFunc; i++){
|
||||
Expr *pExpr = pAggInfo->aFunc[i].pFExpr;
|
||||
assert( pExpr->op==TK_FUNCTION || pExpr->op==TK_AGG_FUNCTION );
|
||||
assert( ExprUseXList(pExpr) );
|
||||
sqlite3ExprAnalyzeAggList(pNC, pExpr->x.pList);
|
||||
if( pExpr->pLeft ){
|
||||
assert( pExpr->pLeft->op==TK_ORDER );
|
||||
assert( ExprUseXList(pExpr->pLeft) );
|
||||
sqlite3ExprAnalyzeAggList(pNC, pExpr->pLeft->x.pList);
|
||||
}
|
||||
#ifndef SQLITE_OMIT_WINDOWFUNC
|
||||
assert( !IsWindowFunc(pExpr) );
|
||||
if( ExprHasProperty(pExpr, EP_WinFunc) ){
|
||||
|
||||
Reference in New Issue
Block a user