mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Use sqlite3ParserAddCleanup() instead of calling sqlite3ExprListDelete()
directly when disposing of an unused ORDER BY in an aggregate function, to avoid disrupting ALTER TABLE data structures. FossilOrigin-Name: d083e42086733ecd79aba8c268e020b01782bfe1cfa9684ce1c277af9c8bf92a
This commit is contained in:
@@ -1223,7 +1223,9 @@ void sqlite3ExprAddFunctionOrderBy(
|
||||
assert( ExprUseXList(pExpr) );
|
||||
if( pExpr->x.pList==0 || NEVER(pExpr->x.pList->nExpr==0) ){
|
||||
/* Ignore ORDER BY on zero-argument aggregates */
|
||||
sqlite3ExprListDelete(db, pOrderBy);
|
||||
sqlite3ParserAddCleanup(pParse,
|
||||
(void(*)(sqlite3*,void*))sqlite3ExprListDelete,
|
||||
pOrderBy);
|
||||
return;
|
||||
}
|
||||
if( IsWindowFunc(pExpr) ){
|
||||
|
Reference in New Issue
Block a user