tdb/begin: use txn id in mem

This commit is contained in:
Minglei Jin 2022-11-28 17:36:33 +08:00
parent 50318f6f96
commit a780305e10
2 changed files with 2 additions and 1 deletions

View File

@ -103,7 +103,7 @@ int32_t tdbBegin(TDB *pDb, TXN **ppTxn, void *(*xMalloc)(void *, size_t), void (
int flags) { int flags) {
SPager *pPager; SPager *pPager;
int ret; int ret;
int64_t txnId = 1; int64_t txnId = ++pDb->txnId;
TXN *pTxn = tdbOsCalloc(1, sizeof(*pTxn)); TXN *pTxn = tdbOsCalloc(1, sizeof(*pTxn));
if (!pTxn) { if (!pTxn) {

View File

@ -382,6 +382,7 @@ struct STDB {
#ifdef USE_MAINDB #ifdef USE_MAINDB
TTB *pMainDb; TTB *pMainDb;
#endif #endif
int64_t txnId;
}; };
typedef struct hashset_st *hashset_t; typedef struct hashset_st *hashset_t;