diff options
author | drh <> | 2022-09-01 13:51:09 +0000 |
---|---|---|
committer | drh <> | 2022-09-01 13:51:09 +0000 |
commit | 44132244fab1d9754a9cc2091372fef1cc1c7997 (patch) | |
tree | 46df8a6689cce2f60130343ecdfa261039575bf3 /src | |
parent | a3fc683c80c41292b03aa89a689ee25ab987fa12 (diff) | |
download | sqlite-44132244fab1d9754a9cc2091372fef1cc1c7997.tar.gz sqlite-44132244fab1d9754a9cc2091372fef1cc1c7997.zip |
Defer deleting a transient SELECT statement associated with a flattening
of one arm of a compound SELECT until after the parse has completed.
FossilOrigin-Name: 1c4157c71cd1e062a9c2c79787d17e34e340f28ce1e40573851dfe174f5da7d7
Diffstat (limited to 'src')
-rw-r--r-- | src/select.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/select.c b/src/select.c index 39ec70f2b..950d0db62 100644 --- a/src/select.c +++ b/src/select.c @@ -3690,10 +3690,11 @@ static int multiSelectOrderBy( */ sqlite3VdbeResolveLabel(v, labelEnd); - /* Reassembly the compound query so that it will be freed correctly + /* Reassemble the compound query so that it will be freed correctly ** by the calling function */ if( pSplit->pPrior ){ - sqlite3SelectDelete(db, pSplit->pPrior); + sqlite3ParserAddCleanup(pParse, + (void(*)(sqlite3*,void*))sqlite3SelectDelete, pSplit->pPrior); } pSplit->pPrior = pPrior; pPrior->pNext = pSplit; |