fix/txnId: wrap around INT64_MAX
This commit is contained in:
parent
7902b7aaac
commit
629c87685f
|
@ -104,6 +104,9 @@ int32_t tdbBegin(TDB *pDb, TXN **ppTxn, void *(*xMalloc)(void *, size_t), void (
|
|||
SPager *pPager;
|
||||
int ret;
|
||||
int64_t txnId = ++pDb->txnId;
|
||||
if (txnId == INT64_MAX) {
|
||||
pDb->txnId = 0;
|
||||
}
|
||||
|
||||
TXN *pTxn = tdbOsCalloc(1, sizeof(*pTxn));
|
||||
if (!pTxn) {
|
||||
|
|
Loading…
Reference in New Issue