1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

When applying the omit-ORDER-BY optimization, defer deleting the AST of

the deleted ORDER BY clause until after code generation ends.

FossilOrigin-Name: f22f95b838873f1d2a320afe3d0f4e4847948fcd343097b93a9f684a6f66d6ba
This commit is contained in:
drh
2022-07-14 01:48:27 +00:00
parent 615aeceaff
commit e834484d89
3 changed files with 11 additions and 9 deletions

View File

@@ -6834,7 +6834,9 @@ int sqlite3Select(
){
SELECTTRACE(0x100,pParse,p,
("omit superfluous ORDER BY on %r FROM-clause subquery\n",i+1));
sqlite3ExprListDelete(db, pSub->pOrderBy);
sqlite3ParserAddCleanup(pParse,
(void(*)(sqlite3*,void*))sqlite3ExprListDelete,
pSub->pOrderBy);
pSub->pOrderBy = 0;
}