Merge pull request #25578 from taosdata/fix/TD-29325

fix(tdb/btc): free txn early when closing btc
This commit is contained in:
Hongze Cheng 2024-04-29 18:04:02 +08:00 committed by GitHub
commit c923faa4bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -2475,7 +2475,12 @@ int tdbBtcMoveTo(SBTC *pBtc, const void *pKey, int kLen, int *pCRst) {
}
int tdbBtcClose(SBTC *pBtc) {
if (pBtc->iPage < 0) return 0;
if (pBtc->iPage < 0) {
if (pBtc->freeTxn) {
tdbTxnClose(pBtc->pTxn);
}
return 0;
}
for (;;) {
if (NULL == pBtc->pPage) {