Merge pull request #27028 from taosdata/fix/TD-31235
fix(tdb/btree): null txn in btc
This commit is contained in:
commit
e7720a4402
|
@ -1660,12 +1660,14 @@ int tdbBtcOpen(SBTC *pBtc, SBTree *pBt, TXN *pTxn) {
|
||||||
if (pTxn == NULL) {
|
if (pTxn == NULL) {
|
||||||
TXN *pTxn = tdbOsCalloc(1, sizeof(*pTxn));
|
TXN *pTxn = tdbOsCalloc(1, sizeof(*pTxn));
|
||||||
if (!pTxn) {
|
if (!pTxn) {
|
||||||
|
pBtc->pTxn = NULL;
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ret = tdbTxnOpen(pTxn, 0, tdbDefaultMalloc, tdbDefaultFree, NULL, 0);
|
int32_t ret = tdbTxnOpen(pTxn, 0, tdbDefaultMalloc, tdbDefaultFree, NULL, 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
tdbOsFree(pTxn);
|
tdbOsFree(pTxn);
|
||||||
|
pBtc->pTxn = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue