mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Consolidate the removal of Window objects from the Select.pWin list into
a single subroutine. FossilOrigin-Name: e46b2afc99329c43de08d4a2e6ade4d2239d7409c5d5626bf272a3e0dd24d1b4
This commit is contained in:
17
src/window.c
17
src/window.c
@@ -1017,15 +1017,24 @@ int sqlite3WindowRewrite(Parse *pParse, Select *p){
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Unlink the Window object from the Select to which it is attached,
|
||||
** if it is attached.
|
||||
*/
|
||||
void sqlite3WindowUnlinkFromSelect(Window *p){
|
||||
if( p->ppThis ){
|
||||
*p->ppThis = p->pNextWin;
|
||||
if( p->pNextWin ) p->pNextWin->ppThis = p->ppThis;
|
||||
p->ppThis = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Free the Window object passed as the second argument.
|
||||
*/
|
||||
void sqlite3WindowDelete(sqlite3 *db, Window *p){
|
||||
if( p ){
|
||||
if( p->ppThis ){
|
||||
*p->ppThis = p->pNextWin;
|
||||
if( p->pNextWin ) p->pNextWin->ppThis = p->ppThis;
|
||||
}
|
||||
sqlite3WindowUnlinkFromSelect(p);
|
||||
sqlite3ExprDelete(db, p->pFilter);
|
||||
sqlite3ExprListDelete(db, p->pPartition);
|
||||
sqlite3ExprListDelete(db, p->pOrderBy);
|
||||
|
Reference in New Issue
Block a user