1
0
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:
drh
2023-10-20 10:18:03 +00:00
parent dcf76a8bbd
commit d707e012f0
3 changed files with 10 additions and 8 deletions

View File

@@ -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) ){