ITS#10212 LMDB: init txnid for read-only DBs

This commit is contained in:
Howard Chu 2024-05-02 16:29:03 +01:00
parent dd2ad2fd5a
commit 4a25e0699b

View File

@ -3278,6 +3278,10 @@ mdb_txn_renew0(MDB_txn *txn)
UNLOCK_MUTEX(rmutex);
return MDB_READERS_FULL;
}
if ((env->me_flags & MDB_RDONLY) && !ti->mti_txnid) {
meta = mdb_env_pick_meta(env);
ti->mti_txnid = meta->mm_txnid;
}
r = &ti->mti_readers[i];
/* Claim the reader slot, carefully since other code
* uses the reader table un-mutexed: First reset the