mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Fix a segfault caused by having identical window functions in the select-list
and ORDER BY clause of a SELECT statement. FossilOrigin-Name: 693b4350d741391226a33ab6a05eaad61e8ef1590176f01e8aed2a212e2d6419
This commit is contained in:
@@ -1243,6 +1243,17 @@ static int resolveOrderGroupBy(
|
||||
}
|
||||
for(j=0; j<pSelect->pEList->nExpr; j++){
|
||||
if( sqlite3ExprCompare(0, pE, pSelect->pEList->a[j].pExpr, -1)==0 ){
|
||||
#ifndef SQLITE_OMIT_WINDOWFUNC
|
||||
if( pE->pWin ){
|
||||
Window **pp;
|
||||
for(pp=&pSelect->pWin; *pp; pp=&(*pp)->pNextWin){
|
||||
if( *pp==pE->pWin ){
|
||||
*pp = (*pp)->pNextWin;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
pItem->u.x.iOrderByCol = j+1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user