aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2023-12-15 20:13:09 +0000
committerdrh <>2023-12-15 20:13:09 +0000
commit40e614e393268a6684d07b1a57ae9bb935d65b5a (patch)
tree099ed08a100af206ca8a23a98904c0ad8c57485b /src
parent97f7ead3f301479fdf45981eb6719622daf20998 (diff)
downloadsqlite-40e614e393268a6684d07b1a57ae9bb935d65b5a.tar.gz
sqlite-40e614e393268a6684d07b1a57ae9bb935d65b5a.zip
In the count-of-view optimization, deferring freeing obsolete parts of the
parse tree, on the off-chance that some other part of the code might be holding a pointer to those parts. FossilOrigin-Name: da442578856c87137eb1677d9b13b7c1cf15828cc41d4756572b278060f69bae
Diffstat (limited to 'src')
-rw-r--r--src/select.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c
index d5b94e2da..121572779 100644
--- a/src/select.c
+++ b/src/select.c
@@ -7135,7 +7135,7 @@ static int countOfViewOptimization(Parse *pParse, Select *p){
pSub->selFlags |= SF_Aggregate;
pSub->selFlags &= ~SF_Compound;
pSub->nSelectRow = 0;
- sqlite3ExprListDelete(db, pSub->pEList);
+ sqlite3ParserAddCleanup(pParse, sqlite3ExprListDeleteGeneric, pSub->pEList);
pTerm = pPrior ? sqlite3ExprDup(db, pCount, 0) : pCount;
pSub->pEList = sqlite3ExprListAppend(pParse, 0, pTerm);
pTerm = sqlite3PExpr(pParse, TK_SELECT, 0, 0);